Error while accessing samba share
Hello,
I've a problem accessing my Red Hat 9.0 share( /tmp ), from my Windows XP laptop. Laptop : Dell Inspiron 5150 + D-Link 614+ Router, Laptop connected thro' cable Linux : Red Hat 9.x[ 2.4.20-27.9 ], Samba[ 2.2.7a-security-rollup-fix ] I followed the instructions in Red Hat Samba Manual and want to share /tmp to be accessible from my laptop. I'm able to see the Samba Server under "workgroup", but when I click it says //Localhost is not accessible. You might not have permission to use this network resource. Contact the adminstrator of this server to find out if you have the access permissions. You were not connected because a duplicate name exists on the network. Go to the System in Control Panel to change hte computer name and try again. First of all, I don't duplicate computer names - Laptop is called "xyz" and the Linux machine is called just localhost [root@localhost samba]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. #127.0.0.1 localhost.localdomain localhost <IP> localhost.localdomain localhost But one related confusion is as why am I seeing both this samba servername and my laptop's description( instead of the name ) in my Network Neighbourhood ??? In the Samba Server Config., I've "share" authentication mode and I've a setup an account( samba ) account, which is actually an existing account to the Red Hat. Also added is a share( /tmp ), which i've given access to everyone, not only to this samba user. What am I doing wrong ???? Appreciate your time and help. Thanks. Kramer. |
localhost is a reserved name for your machine, it's not a machine name it is there for various compatibility etc. reasons. you should run a network config or edit /etc/hosts and give your machine a name..
link your actually ip (not 127.0.0.1) to your machines hostname and then you should be able to read it. |
no luck yet
Ok,
I did the following, but no there yet... now my /etc/hosts reads <IP> localhost.localdomain my_machine I tested the config with testparm and its working fine. I added one more line to smb.conf, in the "global" section netbios name = my_machine next I tried to view this samba share from my laptop( which is the same network with a dlink router inbetween windows and redhat ) 2 problems 1. If I use explorer, it still shows up as "samba server( localhost )" and it complains the same error message I had pasted 1st 1st of all "samba server" is the description I have given in the smb.conf, not my computer name 2. from the samba.org's documentation if I try net use z: \\<IP>\global I get "System error 53 error occured - The network path was not found" What ammmmmmmmm I doing wrong ? Thanks, Kramer. |
a couple ideas that may or may not lead somewhere
did you setup a user in samba - and windows - so you have permission to access the share? can you get to //ip in windows can you get to the win files in linux |
>> a couple ideas that may or may not lead somewhere
>> did you setup a user in samba - and windows - so you have permission to access the share? Yes. From System settings -> Server settings -> Samba Server -> Preferences -> Samba User -> Add User -> < chose one of the existing users( in my linux ) for unix username, windows username, passwords. The unix user-name and the windows user-name are different. >> can you get to //ip in windows Yes. >> can you get to the win files in linux Yes. They're mapped, mounted( thro' /etc/fstab ) and are fully accessible. |
Quote:
If that doesn't work, post your smb.conf file so we can have a look at it. |
smb.conf
[global] # workgroup = NT-Domain-Name or Workgroup-Name netbios name = eashu # server string is the equivalent of the NT Description field server string = samba server # This option is important for security. It allows you to restrict # connections to machines which are on your local network. The # following example restricts access to two C class networks and # the "loopback" interface. For more examples of the syntax see # the smb.conf man page hosts allow = <my ip's> 127. # if you want to automatically load your printer list rather # than setting them up individually then you'll need this name = /etc/printcap ;load printers = yes load printers = no # It should not be necessary to spell out the print system type unless # yours is non-standard. Currently supported print systems include: # bsd, sysv, plp, lprng, aix, hpux, qnx, cups printing = cups # Uncomment this if you want a guest account, you must add this to /etc/passwd # otherwise the user "nobody" is used ; guest account = pcguest # this tells Samba to use a separate log file for each machine # that connects log file = /var/log/samba/%m.log # Put a capping on the size of the log files (in Kb). max log size = 0 # You may wish to use password encryption. Please read # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation. # Do not enable this option unless you have read those documents encrypt passwords = yes smb passwd file = /etc/samba/smbpasswd # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names # via DNS nslookups. The built-in default for versions 1.9.17 is yes, # this has been changed in version 1.9.18 to no. guest ok = yes guest account = shankar security = SHARE dns proxy = no [homes] comment = Home Directories browseable = yes writeable = yes valid users = %S create mode = 0664 directory mode = 0775 [tmp] comment = Temporary file space path = /tmp guest ok = yes writeable = yes |
check your ip address, 127.0.0.1 and localhost are both reserved items
they represent the machine you are physically on, your network, problably shouldnt contain the 127. adress family just to prevent confusion.. |
I'm not using 127.0.0.1, but the real IP.
But as far as 'localhost' is concerned, I've left it in the same format as it was in /etc/hosts IP localhost.localdomain localhost I should be able to access the machine with my IP right - like \\IP\global or \\IP\names |
Windows shares are very strange creatures. Firstly you need to ensure both machines reside in the same workgroup, if they do not then you will have problems accessing the samba shares.
Set your hosts allow driective to either: <network>/<class> or <network>/<netmask> e.g for a 192.68.0.0 network with a 255.255.255.0 netmask use either of these: hosts allow = 192.168.0.0/24 or hosts allow = 192.168.0.0/255.255.255.0 You need to add a workgroup directive too.. This will tell samba what workgroup you are in - make sure this is the same as your winbox. workgroup = myworkgroup If you want to implement username and password based sharing you need to set the security directive to user@ security = user |
Here are 2 suggestions.:
Add the user again via the console: I had a problem this week where I added the user via SWAT, but it never was activated. When I add the user again via the console it worked. Recreate directory share folder: Make sure that users have permissions to Read/Write to the folder. Do this by using groups or by giving full permission to everyone. See if that helps... BTW The explorer view "Samba (localhost)" is correct the localhost is the name of your computer. I would add to your hosts file your ip and computer name than it will show up as "Samba (Computer Name). This is not required it's only a suggestion. |
I think its my firewall( iptables ) that's causing the problem.
I got a suggesstion to clear the iptable entries and I was able to view/access the Linux directories thro' Windows. But after that I had to reboot my Linux machine and now its alienated. But I do see an try for my laptop's IP in the IP tables' list ACCEPT udp -- < laptop-ip > anywhere udp spt:domain dpts:1025:65535 Then why is it kicking the requests out ???? Thanks, Kramer. |
For samba you need to open up inbound and outbound connections on ports 137 through 139 for TCP and UDP.
Something like: #iptables -A INPUT -p tcp --dport 137:139 -j ACCEPT #iptables -A INPUT -p udp --dport 137:139 -j ACCEPT Should do it :) |
I gave both
iptables -A INPUT -p tcp --dport 137:139 -j ACCEPT iptables -A INPUT -p udp --dport 137:139 -j ACCEPT But no luck. Still from my laptop net view doesn't show up the Linux box. |
I'm going to direct you to this trouble shooting link. It goes through most of the problems you are likley to get when setting up samba. With regards to your firewall, try temporairily disabling it and restart samba. If it works then you need to check your firewall config. Heres the link:
http://samba.mirror.ac.uk/samba/ftp/...amba24Hc13.pdf |
All times are GMT -5. The time now is 03:28 PM. |