PDA

View Full Version : Problem connecting to linux samba server from linux client


graeder
18th September 2004, 03:59 AM
I'm having a problem connecting to a linux machine running Fedora 2 and samba from another linux machine running the same. I can connect fine if I boot into windows. I can access the shares, etc. When I try to access the share on the server from linux, I do so using the same usernam and password as I would from Windows. This is the error I receive when I issue the following:

[root@localhost public]# smbclient //linux/home/geoffr -U geoffr
Password:
Domain=[LINUX] OS=[Unix] Server=[Samba 3.0.3-5]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

Any insight?

Also - I can ssh from windows to the server, but not from linux...

dishawjp
18th September 2004, 04:36 AM
Graeder,

Have you edited your /etc/hosts and hosts.allow files to include your remote box's internal IP address? I'm no samba expert... haven't used MSWindows for a long time, but getting Linux to talk to Linux is usually no big deal.

I really need a bit more information to give any real help, but it sounds like your hosts files may be a problem.

Also, if you're connecting Linux to Linux, why use Samba? If you're on a secure (or even insecure for that matter) internal network, why not use telnet, FTP, or ssh? If the remote box is running MSWindows when you're trying to connect and not a real OS, then I can't help you. Hell, I don't even know how to set an internal IP address on a MSWindows box, much less anything else.

What happens if you try to ping the remote box by IP address from the Linux box?

If you're trying to connect Linux to Linux ( or any real OS like VMS ,or OSX, or BSD ), I can probably help you, but I need a bit more info. If this is a MSWindows deal, maybe another member of this forum can offer much bettter advice than I can.

Jim Dishaw

graeder
18th September 2004, 04:53 AM

I'm pretty new to linux and networking with linux, so I didn't even know about the /etc/hosts files. I am trying to connect Linux to Linux, however, I can't even ping the server. It says "host not found." Like I said, in windows it's not a problem. So you suggest editing my hosts and hosts.allow files? Any further info? Thanks for your help.

graeder
19th September 2004, 05:24 AM
Ok, after I made the entry in /etc/hosts I can ping the server, and ssh. However, I still cannot connect to my samba share.
I get the following error even though the share is valid:

smbmount //linux/home/geoffr /mnt/share -o username=geoffr
Password:
3795: tree connect failed: ERRDOS - ERRnosuchshare (You specified an invalid share name)
SMB connection failed

I'm sending the same credentials that I have set up on the file server, and how I connect to the share via windows. I'm stuck...

theninja
23rd September 2004, 07:50 PM
There is no need to use samba to mount *nix to *nix it is simpley an nfs share/mount.
For example after you add the linux box name and ip to /etc/hosts....(add both machines to both /etc/hosts)
Edit this file on the serving system..../etc/exports and add
/sharename remote_client_name
open a shell and enter the follwong commands
exportfs -a
mount machine_name:/sharename /mnt (machine_name = name of the machine, /mnt = the mount point)

That should do it. If you want this to automaticly happen after a reboot, add machine_name:/sharename /mnt
to the /etc/fstab file. Do a man for the flagsyou might need.

Hope this helps

dishawjp
25th September 2004, 03:43 PM
Grader,

I'd be happy to help you further here, but I have never used Samba. Since I don't use MSWindows I have no reason to. I would suggest searching your error message on;

http://www.google.com/linux

You will probably find some help there.

Jim Dishaw

jackspenn
10th January 2005, 04:38 PM
OK, so I had this same problem and just now saw your thread. It is not a Samba or Windows issue. It is a firewall issue. Basically what you need to do is make sure that you have your firewall settings configured to allow the following ports to be accessed:

137 udp
138 udp
139 tcp
445 tcp

If you do not have these ports open you will not be able to connect from remote machines nor will you be able to use "Network Server" application to see your SMB server on the network.

- Eric Jackson

Bruno Mesquita
7th February 2006, 05:12 PM
I was looking for a solution for this problem and find out the SELinux deny access to home directory of the users. You must allow in the configuration file for the home directory.

Bruno.

rioguia
7th February 2006, 06:23 PM
Using samba with SELinux, see: http://forums.fedoraforum.org/forum/showthread.php?t=73849&highlight=selinux+samba

If you eliminate SELinux as an issue, install ethereal and monitor the connection like this:
/usr/sbin/tethereal -i eth#_INTERFACE_OF_LOCAL_NETWORK tcp port 139 and host IP_ADDRESS_SAMBA_CLIENT