You are not logged in.
Hi.
Is it possible to do these things?
Run audio without sudo...
(Un)mount partitions without sudo...
Poweroff, or reboot, without sudo...
For instance, If I run:
adduser myusername audio
I'm told that the user already exists. I'm pretty sure nobody would design a system where everything you do needs to be sudo'ed. What am I doing wrong?
Arch Linux: x86_64, Default Kernel.
Repos: Core, Extra, Community, Multilib.
Offline
To add yourself to a group you need to use gpasswd:
sudo gpasswd -a yourusernamehere audio
Offline
Did you read
https://wiki.archlinux.org/index.php/Beginners'_Guide#Part_IV:_Sound
The appropriate command for adding your user to the audio group is
gpasswd -a myusername audio
For additional groups see
Offline
Poweroff, or reboot, without sudo...
# chmod a+s `which reboot`
will let you reboot without root privileges. The same for other commands. It's insecure though.
Offline
Poweroff, or reboot, without sudo...
# chmod a+s `which reboot`
will let you reboot without root privileges. The same for other commands. It's insecure though.
A better way is to edit sudoers file to run them without password ,then add bunch of aliases to run them easily.
Tamil is my mother tongue.
Offline
Poweroff, or reboot, without sudo...
# chmod a+s `which reboot`
will let you reboot without root privileges. The same for other commands. It's insecure though.
Nasty. Better to use consolekit/upower.
Add on udisk and/or hal, and you got rootless mounting too.
Last edited by Mr.Elendig (2011-01-05 13:51:29)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
You can check pmount for mounting as a user.
Offline
You can mount partitions without using sudo by adding "user" to the "<options>" section in your fstab file.
Part of my fstab for my other disk:
/dev/sda1 /mnt/backup ext4 noauto,user 0 1
I can mount that disk by using "mount /dev/sda1" as a normal user without any problems.
Arch + LXDE
Offline
You can mount partitions without using sudo by adding "user" to the "<options>" section in your fstab file.
Has never worked here... Something else must be needed.
Edit: Ok, I tried harder and it _does_ work at least for my /boot (ext2.) It doesn't work for NTFS partitions and most of my disks use that...
Last edited by stqn (2011-01-05 14:51:41)
Offline
Has never worked here... Something else must be needed.
Weird. I did chown /mnt/backup so I'm the owner of that dir (and anything that's mounted there), but I don't know if that's the case.
Arch + LXDE
Offline
I use pmount/pumount for mounting/unmounting as user.
I've edited my sudoers file to give my user account access (only on this computer) to issue certain commands without a password. As far as I'm concerned, system commands such as shutdown should only be allowed to run as root. It's just a convenience for me not to have to type my password when using sudo.
# less /etc/sudoers
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
tom ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
tom kiwi = NOPASSWD: /sbin/halt
tom kiwi = NOPASSWD: /sbin/reboot
tom kiwi = NOPASSWD: /usr/bin/eject
tom kiwi = NOPASSWD: /usr/sbin/pm-suspend
tom kiwi = NOPASSWD: /home/tom/bin/backup
tom kiwi = NOPASSWD: /etc/rc.d/httpd
Which says: For the user tom on the computer kiwi allow him to run command /sbin/halt without a password.
Last edited by BaconPie (2011-01-05 14:43:09)
Offline
Weird. I did chown /mnt/backup so I'm the owner of that dir (and anything that's mounted there), but I don't know if that's the case.
Sorry, I was wrong: it actually works, just not for NTFS partitions. Directory ownership is not required (I tried with /boot which is owned by root.)
Offline
Try something like this in your fstab:
/dev/sdx /mnt/win ntfs-3g gid=users,umask=0022 0 0
That will allow people in the group 'users' access to the ntfs partition.
Offline
@stqn
Please check the wiki and let's not make OT here.
Offline
After adding my normal user with the 'gpasswd -a' to groups 'audio', 'power', and 'disk', I still can't do any of the original questions.
I don't want to use fstab as my drive configuration is often changing, and I don't want it to do any auto-mounting outside of /. That's a negative on 'pmount' as an option as well. I need to do everything from the command line, with as few apps running as possible.
Arch Linux: x86_64, Default Kernel.
Repos: Core, Extra, Community, Multilib.
Offline
@stqn
Please check the wiki and let's not make OT here.
You are off topic, not me.
Offline
Pmount is not doing any auto-mounting nor dos it run in the background, but AFAIK you can not change the default parent mount point.
What is your objection against sudo (e.g. posts #5 and #11) for these tasks? What do you mean by "running audio" as user? For shutdown, also have a look at /etc/shutdown.allow (shutdown manpage).
Offline
Simply learn how to alias commands job done!
alias foo='string of commands'
In .bashrc
Mr Green
Offline
I know that Solaris has a nice way of adding privileges to a user account - role based access control (RBAC) that should achieve everything OP requested
I haven't tried it, but t looks like SELinux has something similar:
A temporary file is just a pipe with an attitude and a will to live.
Offline
@Who'sThere?, which DE/WM are you using?
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
What do you mean by "running audio" as user?.
I don't have working audio with any apps that use it, unless I run them with sudo.
@Who'sThere?, which DE/WM are you using?
I do almost everything from the command line, but I use Openbox + Tint2 when I absolutely have to run X.
Arch Linux: x86_64, Default Kernel.
Repos: Core, Extra, Community, Multilib.
Offline
Did you log out/in again after adding yourself to the relevant groups? Group additions need to be activated that way.
Offline
Sorry for the late return. I'd been jumping back and forth between various Linux distros.
- Okay, it seems that audio is playing now, good.
- Mounting still needs sudo.
- Powering off, and reboot, still need sudo.
- And after trying to add my user to the group 'dialout', I'm told it doesn't exist.
I'd like to run wvdial as an user. Even with sudo, wvdial will not work aka 'sudo wvdial &'. I have to 'sudo su', and then run 'wvdial &' for it to work.
Last edited by Who'sThere? (2011-01-08 19:38:58)
Arch Linux: x86_64, Default Kernel.
Repos: Core, Extra, Community, Multilib.
Offline
All of your issues could be solved if you followed the advice already offered in the thread.
Posting a menu of items that you still have issues with (when the solutions are in the posts above) is tantamount to help vampirism. Please at least try some of the solutions before posting again.
Offline
Okay. I'm not installing any more services/apps that'll take away processing time, or RAM. This is an older PC.
So my only option is to run with sudo (albeit without password prompts)? No way around it...
Is there any reason I should not remove my user from the 'optical', 'power', and 'disk' groups then?
Also, I don't seem to be able to run wvdial, even with sudo. I end up having to run it from a different console where I've already logged in as root.
Last edited by Who'sThere? (2011-01-08 21:39:18)
Arch Linux: x86_64, Default Kernel.
Repos: Core, Extra, Community, Multilib.
Offline