PDA

View Full Version : Samba Issues


offnetrob
17th November 2006, 07:38 AM
Hi Everyone!!

I am relatively new to Linux and especially Samba. I am running FC 5 and I have updated CUPs and Samba to try and get my machine to act as a small file server.

I was previously getting this error:

You were not connected because a duplicate name exists on the network. Go to system in control Panel to change the computer name and try again.

So I looked around and found that disabling the iptables would get rid of that error and IT DID!!

Now I can see my file server from my windows machine but I get this error:

\\Localhost\rob is not accessible, you might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.

The network path was not found

Here is a sample of my smb.conf file


[global]
workgroup = PIERMARKETING
server string = Server
security = SERVER
username map = /etc/samba/smbusers
log file = /var/log/samba/%m.log
max log size = 50
dns proxy = No
guest ok = Yes

[rob]
path = /home/rob
read only = No
create mask = 0777


Any thoughts?

Thanks
-Rob

woppa30
17th November 2006, 08:34 AM
If you want a "small file server" as you say I would ask if you really need security = server in your smb.conf file. I personally use security = share and don't bother with passwords for my home use. The wife and 14yr old daughter rarely use their network shares from their XP laptops.
The other thing to check is the ownership of youir directory. Also check that you have samba users added, not just linux users and that they have a samba passowrd, not just an account passowrd.
Hope this helps,
woppa

offnetrob
17th November 2006, 06:24 PM

If you want a "small file server" as you say I would ask if you really need security = server in your smb.conf file. I personally use security = share and don't bother with passwords for my home use. The wife and 14yr old daughter rarely use their network shares from their XP laptops.
The other thing to check is the ownership of youir directory. Also check that you have samba users added, not just linux users and that they have a samba passowrd, not just an account passowrd.
Hope this helps,
woppa

Thank you for the reply!

I just changed the owner to "rob" and I changed my security to "share". I restarted Samba and I am still getting the same problem.


[global]
workgroup = PIERMARKETING
server string = Server
security = SHARE
username map = /etc/samba/smbusers
log file = /var/log/samba/%m.log
max log size = 50
dns proxy = No
guest ok = Yes

[rob]
path = /home/rob
read only = No
create mask = 0777

Any ideas?

-Rob

Detonate
17th November 2006, 08:46 PM
See this thread. Your problem may be the name "localhost" which windows also uses, and cause it to display the "duplicate name" error message. This cause me al kinds of problems until I changed the name of my computer to "Linuxbox". Original. eh?

http://forums.fedoraforum.org/showthread.php?t=208

rclark
17th November 2006, 11:24 PM
See above post for good info. See below for other info that may be of interest.

Is 'rob' the name of a linux user? If so then only 'rob' has access to that folder (default permissions) . Therefore if you logged into your Windows box as 'rob' then you should have access IF the smbpasswd and passwd are the same on the linux box. Now if intend the 'rob' folder to be a common directory for users, then you need to change the permissions on the directory (and all files under it) to reflect that with chmod. Normally what I do is mkdir a 'public' folder on the linux box set permissions for 'everyone'. Each user has thier one directory (say user 'rob') but there is a common area for whatever called say 'public'. Then go into the smb.conf file and add a entry as you did and set it up as follows.

[public]
comment = Files Available to all
path = /home/public
public = yes
writeable = yes
browseable = yes
create mask = 0777
force create mode = 0777
directory mode = 2777
directory mask = 0777

Hope that helps!

FWIW, My work public directory is restricted to certain users (project people, and progammers) so mine looks like this:

[public]
comment = Files Available to all
path = /home/public
public = no
valid users = @projects, @programmers
writeable = yes
browseable = yes
create mask = 0777
force create mode = 0777
directory mode = 2777
directory mask = 0777

offnetrob
18th November 2006, 12:25 AM
Thank you to everyone for your help.

I took everyone's advice and changed my hostname and I created the public directory. What should I chmod the public directory to and what should i chown it to?

Thank you
-Rob

rclark
21st November 2006, 05:37 AM
Owner doesn't matter because you are giving everyone access. Just do a chmod -R 777 public . That will give everyone read/write/execute access to that folder. Hope that helps!

offnetrob
21st November 2006, 05:11 PM
Owner doesn't matter because you are giving everyone access. Just do a chmod -R 777 public . That will give everyone read/write/execute access to that folder. Hope that helps!

Thank you for your help once again....I am still getting a "not acessible" and "network path not found"

I am totally stumped!!!

Anyone willing to SSH into my server and give it a whirl?!!?!

-Rob

johannlo
26th November 2006, 12:30 PM
remember in samba u need both
- samba user
- normal linux user to match the samba user!!!

also SELinux stuffs it - I just turn it off, I'm no guru :)

Refer here for fantastic samba documentation , specifically, chaps 10-12 cover samba. Got me running from total zero when I first started using nix two years ago!

http://www.linuxhomenetworking.com/#Linux

offnetrob
29th November 2006, 05:07 AM
remember in samba u need both
- samba user
- normal linux user to match the samba user!!!

also SELinux stuffs it - I just turn it off, I'm no guru :)

Refer here for fantastic samba documentation , specifically, chaps 10-12 cover samba. Got me running from total zero when I first started using nix two years ago!

http://www.linuxhomenetworking.com/#Linux

I just tried this. It worked like a champ!!

Thank you!!!

Missing_QuarK
18th December 2006, 02:19 PM
Yes finally, i 2 had the same problem. Turned off SELinux and bingo access to files.

What is SELinux used for?? is turning it off going to expose my server?

johannlo
27th December 2006, 07:26 AM
Nah - even w/out SELinux ur much more secure than say win2k3 server.

Its an additional layer of security that restricts specific access to threads, memory spaces, etc. basically stopping unauthorised processes from accessing files, or even memory spaces or even running at all.

Its super secure but for your normal linux user its going to be more of a headache than anything else, you're going to have to configure it specifically to allow heaps of stuff that would otherwise just 'work' - like SAMBA

If ur worried about security, just make sure u have a good iptables config - i.e. block all incoming ports except ones you need (e.g. the samba ports!!!).

Of course don't run as root unless u have to. Also turn off unnecessary services that you can login to e.g. telnet, ssh, the like. If u run SSH, change it to a non-default port.