![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to mount disk for non-root accounts? | siegfried | UNIX for Dummies Questions & Answers | 11 | 03-17-2007 10:36 PM |
| How to mount disk for non-root accounts? | siegfried | UNIX for Dummies Questions & Answers | 4 | 08-28-2006 05:47 AM |
| How do i access (mount, read & write) a floppy disk from the console, not being root? | kfaday | UNIX for Dummies Questions & Answers | 4 | 05-13-2005 12:17 PM |
| solaris 8 admin I text ambiguities on mount and umount | xyyz | UNIX for Dummies Questions & Answers | 2 | 10-10-2002 09:57 AM |
| Writing a script to mount and umount a drive in Linux | wizkid | UNIX for Dummies Questions & Answers | 2 | 05-10-2001 07:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to mount/umount disk from a non-root account
Is it possible to mount a disk from a non-root account?
I'm developing a Java application which executes commands in the shell using the java.lang.Runtime.exec api, which runs fine for commands ls, df, etc., but for commands mount and umount, i have problems as I need to be root to eecute these. But my application must run as a standard out of the box. Any ideas on getting mount/umount running from my non-root user account? |
|
||||
|
If you can define earlier which resources you want to mount/unmount using your application it can be added to /etc/fstab with user option (allow a user to mount).
You can configure sudo for it as well. Dirty method - add suid bits to mount/umount command and try to manage access using groups. Regards, -Artur. |
|
||||
|
I've edited the /etc/fstab and added user option Code:
/dev/loop1 /storage/part1 auto noauto,user,noexec 0 0 My version of mount/umount is: Code:
[brendan@rubidium /]$ mount -V mount: mount-2.12a I can mount ok as user root, but ordinary user gets: Code:
[brendan@rubidium ~]$ mount /dev/loop1 /storage/part1 -o user mount: only root can do that Is this a bug perhaps? Sudo prompts for password, using Java runtime exec, this is not an option. Setting suid bits may be the way to go if all else fails
Last edited by brendan76; 03-06-2008 at 01:48 PM.. |
|
||||
|
[mount problem]
It's strange - I'm using: mount: mount-2.12p I can't test it now, but can you check permissions to file which you want to mount? [sudo] I'm sure you can configure sudo without asking for a password. As far as I remember I did it long time ago. [suid] I don't recommend it. Regards, -Artur. |
|
||||
|
Have you check permissions to file which you want to mount on loopback? I havn't seen any comment about it.
Regarding sudo configuration - it's not the best idea to provide access for ALL commands, you can choose a list which is required by you. Regards, -Artur. |
![]() |
| Bookmarks |
| Tags |
| unix commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|