SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've got a problem in doing sudo working for mounting things (e.g. usb pen or optic discs). Details:
The OS: Slackware 13.0
The response to sudo -l command:
Code:
User user1 may run the following commands on this host:
(root) /sbin/shutdown -h now, /sbin/shutdown -r now
(root) /usr/bin/less /var/log/syslog
(root) /sbin/mount /dev/sda?, /sbin/umount /dev/sda?
(root) /sbin/mount /dev/hdc, /sbin/umount /dev/hdc
The first two (shutdown and reading the syslog) works as sudo, but the problem appears when I try to mount an usb memstick or an cd/dvd disc. In my case, sda (sda1) is the memstick in /dev, which I can mount as root using su, mount /dev/sda1 /media/usb.
When I try to mount it using sudo mount /dev/sda1 /media/usb, doesn't work, I get the response:
Code:
Sorry, user user1 is not allowed to execute '/bin/mount /dev/sda1 /media/usb' as root on HOST1.
Firstly, I don't understand why the OS thinks user1 wants to execute /bin/mount when in sudoers is /sbin/mount.
If I use the full path sudo /sbin/mount /dev/sda1 /media/usb, still doesn't work:
Code:
Sorry, user user1 is not allowed to execute '/sbin/mount /dev/sda1 /media/usb' as root on HOST1.
Here user1 is not allowed to execute /sbin/mount as root, why? According to sudo -l should have this privilege.
But after I mount the /dev/sda1 using su, I can umount it using sudo umount /dev/sda1
What's wrong? Why the umount works and mount doesn't?
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
Rep:
Quote:
Originally Posted by sasser
Hello,
I've got a problem in doing sudo working for mounting things (e.g. usb pen or optic discs). Details:
The OS: Slackware 13.0
The response to sudo -l command:
Code:
User user1 may run the following commands on this host:
(root) /sbin/shutdown -h now, /sbin/shutdown -r now
(root) /usr/bin/less /var/log/syslog
(root) /sbin/mount /dev/sda?, /sbin/umount /dev/sda?
(root) /sbin/mount /dev/hdc, /sbin/umount /dev/hdc
The first two (shutdown and reading the syslog) works as sudo, but the problem appears when I try to mount an usb memstick or an cd/dvd disc. In my case, sda (sda1) is the memstick in /dev, which I can mount as root using su, mount /dev/sda1 /media/usb.
When I try to mount it using sudo mount /dev/sda1 /media/usb, doesn't work, I get the response:
Code:
Sorry, user user1 is not allowed to execute '/bin/mount /dev/sda1 /media/usb' as root on HOST1.
Firstly, I don't understand why the OS thinks user1 wants to execute /bin/mount when in sudoers is /sbin/mount.
If I use the full path sudo /sbin/mount /dev/sda1 /media/usb, still doesn't work:
Code:
Sorry, user user1 is not allowed to execute '/sbin/mount /dev/sda1 /media/usb' as root on HOST1.
Here user1 is not allowed to execute /sbin/mount as root, why? According to sudo -l should have this privilege.
But after I mount the /dev/sda1 using su, I can umount it using sudo umount /dev/sda1
What's wrong? Why the umount works and mount doesn't?
Thanks.
As far as I know you have to type the commands exactly as they are used on the command line, in your example you are missing the last part, the mount point! Guess it will work if you try in your sudoers file "/sbin/mount /dev/sda1 /media/usb" instead or use wildcards like "/sbin/mount /dev/sda1 *".
As far as I know you have to type the commands exactly as they are used on the command line, in your example you are missing the last part, the mount point! Guess it will work if you try in your sudoers file "/sbin/mount /dev/sda1 /media/usb" instead or use wildcards like "/sbin/mount /dev/sda1 *".
Yes, it worked, thanks.
Now I understand why the umount had worked and mount didn't in my initial setup.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.