Networking Forums

Networking Forums > Computer Networking > Linux Networking > mount -t smbfs ... only root can do that

Reply
Thread Tools Display Modes

mount -t smbfs ... only root can do that

 
 
James
Guest
Posts: n/a

 
      01-01-2004, 08:20 PM
Hi

I'm trying to mount a windows share from a linux box as a regular user

~$ mount -t smbfs -o username=james,password=123 //caspian/E caspian

and I get "mount: only root can do that"

I have googled till I'm blue and only found references to ensuring that the
suid bit is set (and it is) on smbmount and smbmnt as is mount

-rwsr-xr-x 1 root root 8056 Sep 25 19:57 /usr/bin/smbmnt
-rwsr-xr-x 1 root root 575372 Sep 25 19:57 /usr/bin/smbmount
-rwsr-xr-x 1 root root 76888 Dec 7 05:35 /bin/mount

other solutions suggest autofs which doesn't seem to be an option - at
least not until I get this working. I am running Debian (testing) distro on
a pretty standard setup

any help would be greatly apreciated

J
 
Reply With Quote
 
 
 
 
Andrey Asadchev
Guest
Posts: n/a

 
      01-01-2004, 10:05 PM
James wrote:
> Hi
>
> I'm trying to mount a windows share from a linux box as a regular user
>
> ~$ mount -t smbfs -o username=james,password=123 //caspian/E caspian
>
> and I get "mount: only root can do that"


Try

$ smbmount -o username=james,password=123 //caspian/E caspian
$ smbumount caspian

if you do mount through /etc/fstab, give "user" as one of the options.

//caspian/E /caspian smbfs defaults,user,username=james,pasword=123 0 0


 
Reply With Quote
 
James
Guest
Posts: n/a

 
      01-02-2004, 06:22 AM
Andrey Asadchev <(E-Mail Removed)> wrote in news:bt2947$2k02b$1
@ID-134500.news.uni-berlin.de:

> James wrote:
>> Hi
>>
>> I'm trying to mount a windows share from a linux box as a regular user
>>
>> ~$ mount -t smbfs -o username=james,password=123 //caspian/E caspian
>>
>> and I get "mount: only root can do that"

>
> Try
>
> $ smbmount -o username=james,password=123 //caspian/E caspian
> $ smbumount caspian
>
> if you do mount through /etc/fstab, give "user" as one of the options.
>
> //caspian/E /caspian smbfs defaults,user,username=james,pasword=123 0 0
>
>
>


Hmmm - tried that and get the following


"Usage: mount.smbfs service mountpoint [-n] [-o options,...]
Version 3.0.0-Debian

Options:
username=<arg> SMB username
....
....
....
This command is designed to be run from within /bin/mount by giving
the option '-t smbfs'. For example:
mount -t smbfs -o username=tridge,password=foobar //fjall/test
/data/test"

My conclusion so far, is if smbmount and smbmnt are suid root but won't
mount a smb share as a regular user it must be (a) hard coded at compile
time or (b) managed by a wrapper or (c) be referring to an external
config file or system wide security setting much like Suse has with their
permissions.XXX file, don't know if Debian has a similar option,

any ideas ??

J
 
Reply With Quote
 
Andrey Asadchev
Guest
Posts: n/a

 
      01-02-2004, 07:19 AM
James wrote:
> Andrey Asadchev <(E-Mail Removed)> wrote in news:bt2947$2k02b$1
> @ID-134500.news.uni-berlin.de:
>
>
>>James wrote:
>>
>>>Hi
>>>
>>>I'm trying to mount a windows share from a linux box as a regular user
>>>
>>>~$ mount -t smbfs -o username=james,password=123 //caspian/E caspian
>>>
>>>and I get "mount: only root can do that"

>>
>>Try
>>
>>$ smbmount -o username=james,password=123 //caspian/E caspian
>>$ smbumount caspian
>>
>>if you do mount through /etc/fstab, give "user" as one of the options.
>>
>>//caspian/E /caspian smbfs defaults,user,username=james,pasword=123 0 0
>>
>>
>>

>
>
> Hmmm - tried that and get the following
>
>
> "Usage: mount.smbfs service mountpoint [-n] [-o options,...]
> Version 3.0.0-Debian
>
> Options:
> username=<arg> SMB username
> ...
> ...
> ...
> This command is designed to be run from within /bin/mount by giving
> the option '-t smbfs'. For example:
> mount -t smbfs -o username=tridge,password=foobar //fjall/test
> /data/test"
>
> My conclusion so far, is if smbmount and smbmnt are suid root but won't
> mount a smb share as a regular user it must be (a) hard coded at compile
> time or (b) managed by a wrapper or (c) be referring to an external
> config file or system wide security setting much like Suse has with their
> permissions.XXX file, don't know if Debian has a similar option,
>
> any ideas ??
>
> J


Hi
Sorry man, i messed up a bit
$ smbmount -o username=james,password=123 //caspian/E caspian
should be
$ smbmount //caspian/E caspian -o username=james,password=123

optionss go in the back

I double checked on my machine just to make sure (i run debian too) :-)

Anyways.

mount is setuid but only filesystems listed in fstab are allowed for
mounts (with user flag) - afaik.
when you pass "-t smb(fs)?", mount actually calls /sbin/mount.smb(fs)?
If you do

$ ls /sbin/mount.smb*
lrwxrwxrwx 1 root root 17 Dec 31 21:12 /sbin/mount.smb
-> /usr/bin/smbmount
lrwxrwxrwx 1 root root 17 Dec 31 21:12
/sbin/mount.smbfs -> /usr/bin/smbmount

From man page of smbmout
NOTE: smbmount calls smbmnt(8) to do the actual mount. You must make
sure that smbmnt is in the path so that it can be found

$ ls -al /usr/bin/smbmnt
-rwsr-xr-x 1 root root 430760 Apr 7 2003 /usr/bin/smbmnt

smbmnt does final magic and it is setuid.

hope this does not make stuff too muddy. good luck.


 
Reply With Quote
 
James
Guest
Posts: n/a

 
      01-02-2004, 10:38 AM
>
> I double checked on my machine just to make sure (i run debian too)
> :-)
>
> Anyways.
>
> mount is setuid but only filesystems listed in fstab are allowed for
> mounts (with user flag) - afaik.
> when you pass "-t smb(fs)?", mount actually calls /sbin/mount.smb(fs)?
> If you do
>
> $ ls /sbin/mount.smb*
> lrwxrwxrwx 1 root root 17 Dec 31 21:12
> /sbin/mount.smb -> /usr/bin/smbmount
> lrwxrwxrwx 1 root root 17 Dec 31 21:12
> /sbin/mount.smbfs -> /usr/bin/smbmount
>
> From man page of smbmout
> NOTE: smbmount calls smbmnt(8) to do the actual mount. You must make
> sure that smbmnt is in the path so that it can be found
>
> $ ls -al /usr/bin/smbmnt
> -rwsr-xr-x 1 root root 430760 Apr 7 2003
> /usr/bin/smbmnt
>
> smbmnt does final magic and it is setuid.
>
> hope this does not make stuff too muddy. good luck.
>
>
>



eureka it works - one change was that I had chown /etc/samba to
root:users group users - not sure that is a good thing - otherwise i got

"
params.c:OpenConfFile() - Unable to open configuration file
"/etc/samba/smb.conf":
Permission denied
Can't load /etc/samba/smb.conf - run testparm to debug it
"
many thanks for the help - next time I'll persevere with the man page ;-)

regards - and happy new year



James
 
Reply With Quote
 
Robert Pearce
Guest
Posts: n/a

 
      01-02-2004, 04:25 PM
In article <bt2947$2k02b$(E-Mail Removed)>, Andrey
Asadchev <(E-Mail Removed)> writes
>James wrote:
>> Hi
>> I'm trying to mount a windows share from a linux box as a regular
>>user
>> ~$ mount -t smbfs -o username=james,password=123 //caspian/E caspian
>> and I get "mount: only root can do that"

>
>Try
>
>$ smbmount -o username=james,password=123 //caspian/E caspian
>$ smbumount caspian
>
>if you do mount through /etc/fstab, give "user" as one of the options.
>
>//caspian/E /caspian smbfs defaults,user,username=james,pasword=123 0 0
>
>

And if you want users to be able to mount it using "mount", you _must_
declare it in /etc/fstab (with the "user" option). This is because not
doing so means you need to tell mount what type of mount to do (with -t)
and this is only ever allowed for root.
--
Rob Pearce

The "from" must be wrong, nothing that helpful ever comes from the TAN team!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mount: only root can do that bbaruah2003@yahoo.com Linux Networking 3 02-08-2006 05:49 AM
Postfix config - cron messages for root going to root@ISP. Doug Laidlaw Linux Networking 5 02-27-2005 03:21 PM
NFS mount won't mount at boot, but mount -a works fine. BT Linux Networking 2 09-23-2004 09:37 PM
NFS exporting smbfs mount? K. Bruner Linux Networking 0 09-09-2004 08:25 PM
mount -t smbfs problems J. Shrimp, Jr. Linux Networking 2 11-21-2003 10:39 AM



1 2 3 4 5 6 7 8 9 10 11