- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- enable mount for ordinary user ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 09:02 AM
тАО01-03-2011 09:02 AM
enable mount for ordinary user ?
mount: only root can do that
[user@xxx]$ mount user
[user@xxx]$ mount: can't find user in /etc/fstab or /etc/mtab
[user@xxx]$ uname -a
Linux xxx 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
How to sort that out ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 09:21 AM
тАО01-03-2011 09:21 AM
Re: enable mount for ordinary user ?
mount -t cifs -o username=administrator,password=xxx //10.25.1.1/backup /data
is failing because, as a non-root user, you do not have mount privileges.
On the second command failing :
mount user
you are trying to mount a filesystem named user and there is no such filesystem to start with, but if there were one, you would get the same error message as you got on the first one.
I am sure you have the sudo utility installed by default (if not, install it using a method convenient to you), then, create a script with the mount command that you want placed in it, and give permission to run this script as root user to the person you want running it.
After installing sudo, check the man page to figure out how to accomplish this, or just simply edit the /etc/sudoers file and see the examples. It is really simple
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 11:58 AM
тАО01-03-2011 11:58 AM
Re: enable mount for ordinary user ?
If so, autofs (NFS automounter) may just be what the doctor prescribed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 12:21 PM
тАО01-03-2011 12:21 PM
Re: enable mount for ordinary user ?
...user Allow an ordinary user to mount the filesystem. The name of the mounting user is written to
mtab so that he can unmount the filesystem again. This option implies the options noexec,
nosuid, and nodev (unless overridden by subsequent options, as in the option line
user,exec,dev,suid).
So no - I am not trying to mount anything here. I'm just trying to change the option so everyone can mount this share, but for some reason it doesn't work:
[user@xxx]$ mount: can't find user in /etc/fstab or /etc/mtab
So let me repeat the question:
How do I enable mount for a non-root user?
[user@xxx]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
[user@xxx]# cat /etc/mtab
/dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sda1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2011 01:07 PM
тАО01-03-2011 01:07 PM
Re: enable mount for ordinary user ?
##############
10.25.1.1/backup /data cifs rw,users,owner,noauto,username=administrator,password=xxx
##############
anything between two lines containing ############## goes into one single line in case forum screen limits split them into two, separated by space(s) or tab(s)
Be aware that I am not sure about the use of username=blah,password=blah in the options. If it the system complains, take them out and provide them from command line as you initially did, but the phrase "users" is the one you are looking for. This string of options, separated by comma (",") replaces the defaults on the lines which are in your fstab right now.
Hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2011 02:25 AM
тАО01-04-2011 02:25 AM
Re: enable mount for ordinary user ?
- user
- users
- owner
- group
Although they are listed on the mount(8) man page, these options make sense only when added to /etc/fstab.
In Mel's example, both "users" and "owner" are used - this is incorrect. One of them is enough.
"users" allows any user to mount the filesystem, and once mounted, any user can also unmount it.
"user" allows any user to mount the filesystem, but only root or the user who mounted it can unmount it.
"owner" allows the owner of the device file to mount or unmount that filesystem.
"group" allows mounting or unmounting the filesystem if the user is a member of the group the device file belongs to.
The last two are not appropriate for NFS or CIFS mounts: there is no device file.
When mounting a CIFS filesystem as a regular user, the user must own the mount-point directory or the mount will fail.
The /sbin/mount.cifs must be setuid root, or the ordinary users won't be able to mount CIFS filesystems at all.
(chown root /sbin/mount.cifs; chmod u+s /sbin/mount.cifs)
/etc/fstab must usually be readable by everyone, so putting passwords in it is not a good idea. Instead, the "cred=" option allows putting the username and password into a separate file, which you can protect with more restrictive permissions.
To avoid the password prompt, you will also need the option "guest".
It's likely you'll also need the option "dom=" to specify the workgroup/domain name you're using for Windows authentication.
For more information about available options when making CIFS mounts, please read "man mount.cifs".
This is how I would do it:
############
//10.25.1.1/backup /data cifs rw,noauto,users,dom=domain,cred=/somewhere/backup.cred,guest 0 0
############
And the contents of the file /somewhere/backup.cred should look like this:
############
username=administrator
password=xxx
############
Once all this is set up, the ordinary user (that owns the /data directory) can mount and unmount this CIFS share using the short form of the mount/umount commands:
mount /data
umount /data
By the way, using the Windows administrator account for CIFS mounts like this is bad for security: you should have the Windows administrator create a separate account with appropriate privileges for this purpose.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2011 09:51 PM
тАО01-04-2011 09:51 PM
Re: enable mount for ordinary user ?
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
//10.25.1.1/backup /data cifs rw,noauto,users,cred=/root/backup.cred,guest 0 0