Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a FreeBSD server in the office that is used as a web server and file server. It shares a few directories with the rest of the computers in the office, which are WinXP and CentOS computers.
On the WinXP computers, I can access the samba shares that are located on the FreeBSD server just fine, I can read and write, no problem.
Now, on my CentOS computer, access to these samba shares is a little odd to the least:
- I can access samba shares only mounting them, and they don't appear when I click in Gnome on "Applications > Network Servers", which is a blank window. The samba shares show up on the WinXP computers just fine.
- It takes around 30 secs to mount the share (way too much)
- After mounting the samba shares, they show up under /mnt as expected, now:
* I can create a file or a directory in /mnt/www but I can't remove them
* I can create a file or a directory in /mnt/www but I can't create others under /mnt/www/whatever
* If I open an existing file in /mnt/www, I can read it but can't save it
* If I open an existing file in /mnt/www/whatever, it is blank
There is no need to type a password to access the shares. Here's what I use to mount the samba shares:
Code:
mount -t smbfs -o ip=192.168.0.2,uid=500,defaults,password='' //servidor/www /mnt/www
I have tried to solve this problem in vain, do you have an idea?
Thanks,
So I always include the read write command with it just incase.
Code:
mount -t smbfs //windows/share /mnt/point -o rw,username=me,password=god
Remember that if you use gid and uid that the id's have to be the same as the user/group that you want. I've made this mistake so many times, I thought it's worth saying. Also check that the windows box gives write access on that drive.
If your useing KDE try Konquoer to read and write to the samba drive. ie
Hi there,
Perhaps posting the share sections of your smb.conf would help. Do you have any odd ACLs in there (Create Mask, etc.)?
Also, what are the Unix permissions on the directory in question on your samba server?
Relatedly, is it possible that the user authenticating against the Samba server does not have permissions as a Unix user on the Samba machine (each user must be registered in both the samba password backend and the Unix one, unless your share is a guest only one). I've made this mistake before and forgotten to add the Unix account.
Finally, if none of the above helps, you might do a capture using Ethereal during a mount and access to see what your smb.mount daemon is saying to the Samba server and vice versa.
[WWW]
comment = Development
read only = no
path = /usr/local/servidor/www/
guest account = www
guest ok = yes
force create mode = 774
force directory mode = 774
[Documentos]
comment = Pasta geral do escritorio
read only = no
path = /usr/local/servidor/documentos
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774
[Design]
comment = Pasta de Arquivos Design
read only = no
path = /usr/local/servidor/design
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774
[Documentos Internos]
comment = Documentos Internos
read only = no
path = /usr/local/servidor/interno
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774
hosts allow = 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4
hosts deny = 0.0.0.0/0
[TMP]
comment = Arquivos Temporários
read only = no
path = /usr/local/servidor/tmp
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774
So, according to you, I need to add remote Unix users somewhere in the configuration of Samba on my file server? Do you know a tutorial that would explain this to me please?
Thanks,
Hi Calande,
Some observations on your share definitions. Hopefully other list readers will correct me if I'm wrong.
As I noted, you need to have both a UNIX/Linux account for your users and Samba accounts, unless you want to allow password-less, public access. First some observations on your shares:
[WWW]
comment = Development
read only = no
path = /usr/local/servidor/www/
guest account = www
guest ok = yes
force create mode = 774
force directory mode = 774
In the case of your WWW share, you need a Unix/Linux account for the guest user "www". Does this account exist and does it have read/write permissions on /usr/local/servidor/www? ls -l /usr/local/servidor/www will tell you the perms on that directory's files. Also check perms on the dir itself (ls -ld). The linux user www must have read-write perms b/c samba will use the credentials of www to access /usr/local/servidor/www. The linux kernel will then allow or deny Samba's attempts based on those credentials (Samba only has the same privileges as the user accessing the Samba share).
[Documentos]
comment = Pasta geral do escritorio
read only = no
path = /usr/local/servidor/documentos
guest ok = yes
guest account = nobody
force create mode = 774
force directory mode = 774
In the case of your Documentos share, the user "nobody" may be the problem. nobody, if I'm not mistaken, is a pretty restricted user on Linux systems, so it's doubtful whether nobody would have permission to access /usr/local/servidor/documentos.
One way to test this is to su to nobody or su to www and try performing operations at the command line within those directories.
It could be that access from your WinXP machines is problem-free because they are bypassing the guest account. If your Windows XP account is "Calande" and calande has a linux account, then Samba allows access to these shares as user calande, not as user "nobody" or user "www". However, the mount command is usually only executed as Root so when you mount samba shared on you CentOS file system, you're authenticating to Samba as root. Samba may not allow root (esp. if root does not have a Samba account) in which case, Samba lets you connect using the guest account of "www" or "nobody" depending on the share.
The commands for managing users on Linux are useradd and usermod. The command for adding users to Samba is smbpasswd or pdbedit, both of which have man pages.
If you want to truly simplify things, you could just add "guest only = yes" (guest *only*, not guest OK) to each share definition which would allow/force everyone to connect without an account. You'd still have to make sure your guest accounts had permissions in Linux to access the directories/files, but at least then you'd be certain everyone using Samba (whether from CentOS or WinXP) was using only the prescribed guest accounts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.