Click to See Complete Forum and Search --> : Use smbclient or LinNeighborhood as non-root user
cowanrl
05-12-2002, 03:56 PM
When trying to mount Samba shares on other machines using smbclient or LinNeighborhood as a non-root user I get this error:
smbmount must be installed suid root for direct user mounts
I did a Google search on this and it said to use chmod 4755 /usr/bin/smbmount. I did this and now the error message I get is:
libsmb based programs must *NOT* be setuid root
smb connection failed
It works OK when logged in as root.
Has anybody ever gotten these to work as a non-root user?
Using Red Hat 7.3, smbmount version 2.2.3a and LinNeighborhood version 0.6.3
Hm, same setup I've got here, and smbmount is indeed setuid:
[root@penguinbox/etc]# ls -l /usr/bin/smbmount
-rwsr-xr-x 1 root root 306268 Apr 12 2001 /usr/bin/smbmount*
I'm sorry I can't help you, except to say that it works for non-root users on my system.
cowanrl
05-13-2002, 05:01 AM
Interesting.
Would you mind sharing what Linux Distro you are using and what version of smbmount you are using? Also, do you actually have Samba installed and running on the computer you are executing those commands from?
I can't get past the "libsmb based programs must *NOT* be setuid root" error.
Mandrake 8.0
Samba 2.0.7
LinNeighborhood 0.6.3
Hmm- I thought my version of Samba was also 2.2.3; that might make difference.
<STRONG>do you actually have Samba installed and running on the computer you are
executing those commands from?</STRONG>Yes.
DJKAOS
05-13-2002, 05:24 PM
I have Mandrake 8.1
samba (whatever the newest one is..I just got it.)
and I also can't get LinNeighbrhood to mount network drives unless I am root. (I get a diffrent error than you though)
michaelk
05-14-2002, 07:39 AM
You can add a smb share to /etc/fstab but add the options not to mount it on startup and user mount. Then a non-root user should be able to mount it.
mychl
05-14-2002, 10:11 AM
Originally posted by michaelk:
<STRONG>You can add a smb share to /etc/fstab but add the options not to mount it on startup and user mount. Then a non-root user should be able to mount it.</STRONG>
Even so, you will still get the message about having smbmnt SUID. I dont' know about the other message though... I'm looking.
sunpuke
05-18-2002, 11:18 AM
You could just use sudo to execute root commands as a non-root user. First edit the sudoers file with visudo (as root) and add an entry for a user like:
username ALL=NOPASSWD: ALL
Save the file then login as you and you should be able to use smbmount with no problem.
A possible problem with smbmount could be the way it was compiled. Some binaries have to be compiled specifically with the option not to be run setuid/setgid.
NeilBlue
05-18-2002, 02:31 PM
Hello,
I had many suid problems with these samba GUI's. In the end I went for XSMBrowser, which I have found to be simple and effective :)
Neil
cowanrl
05-18-2002, 02:37 PM
I finally figured it out!! At least for Red Hat 7.3.
The key is to suid root /usr/bin/smbmnt, not /usr/bin/smbmount. I guess smbmount calls smbmnt.
Anyhow, after executing these commands as root:
chmod u+s /usr/bin/smbmnt
chmod u+s /usr/bin/smbumount
I can now use smbmount and smbumount as a non-root user. Even LinNeighborhood works great.
Sunpuke, I was able to get your suggestion to work(what a cryptic file that sudoers is). However, that allowed a non-root user to execute the smbmount command but root still owned the mount point. The non-root user didn't have write priveleges to the mounted smb share. smbmount is supposed to support a uid option to allow you to set the user who owns the mount point but I couldn't get that to work.
Thanks for all your help and suggestions.