Home arrow Wiki arrow mounting windows shares on Linux with non-root users
Main Menu
Home
Help Docs
Newbies
Corporates
Gnu/Linux Distros
Programming
Databases
Links
Search
Regular
News
Interviews
Aaj Ka Tip
Aaj Ka Command
Community
Blogs
Wiki
Forums
Services
Free Software

mounting windows shares on Linux with non-root users Print E-mail

You can always mount windows shares on Linux machines using

smbmount '//<IP ADDR>/<Share Name>' <path to be mounted> -o username=<username> workgroup=<work group name

This does not allow the non-root users to write in this directory.

If you try to chaning the owner of the directory like

chown -R  <username> <path of the mounted share>

it will report an error ,such as "operation not permitted "

changing the permissions of the directory won't work.

So the solution to this is to sue smbmount with the user(non-root user) for which write access is required.

if you try the same smbmount command with the non-root user then the error you get is,

smbmnt must be installed suid root for direct user mounts (500,500)
smbmnt failed: 1

In this case this error can be resolved by setuid permissions on the smbmnt command.

chmod +s /usr/bin/smbmount

You need to try again to mount the shared folder and it should work this time.

If you get an error like this in some Linux OS
"libsmb based programs must *NOT* be setuid root."

Then try this
chmod +s /usr/bin/smbmnt


instead of
chmod +s /usr/bin/smbmount

If you have already set the suid bit for /usr/bin/smbmount, then unset it as
chmod -s /usr/bin/smbmount
< Previous   Next >



gnulinuxclub
Join Us
About Us
Contact Us
Support Us
Acknowlegdement
Login(only for dev.)

Royalty Free Images

O'Reilly User Group discount!




Powered By GIMP GIMP
Contact Webmaster Copyleft 2011 gnulinuxclub.org