Does anyone know how to mount SMB shares as a normal user?
I want to mount a SMB share from a Windows XP box on my Linux (Kubuntu) box with an unprivileged user and without adding the mount point to
fstab.
Here are the two commands I've tried:
Code:
mount -t cifs -o username=king,password=kong //xp/C\$ /home/ghodmode/xp/C\$
mount -t smbfs -o username=king,password=kong //xp/C\$ /home/ghodmode/xp/C\$
When I try this, I get the message
mount: only root can do that. It works if I run the command with sudo.
I can use
Smb4K to accomplish this task without providing my root or sudo password. When I look at the mount points while a share is mounted using Smb4K, I can see that the share is mounted as cifs, but I can't tell how it did it.
All of the related commands have the setuid bit set:
Code:
ghodmode@home:~$ ls -l /bin/mount /sbin/mount.smb /usr/bin/smbmount /sbin/mount.cifs
-rwsr-xr-x 1 root root 80568 2007-10-03 17:48 /bin/mount
-rwsr-xr-x 1 root root 22628 2007-12-18 20:28 /sbin/mount.cifs
lrwxrwxrwx 1 root root 17 2008-02-04 11:08 /sbin/mount.smb -> /usr/bin/smbmount
-rwsr-xr-x 1 root root 906292 2007-12-18 20:28 /usr/bin/smbmount
Thank you,
Ghodmode