![]() The only stumbling block was the user to be. Then you would call from the terminal: sudo -u user2 /Applications/Skype. visudo Config changes Allow user to sudo su as anyone without password user ALL(ALL) NOPASSWD: ALL group ALL(ALL) NOPASSWD: ALL Allow user to become another user user ALL(user2) NOPASSWD: ALL group ALL(user2) NOPASSWD: ALL now with the latter sudo su - user2 should work. I assume you have Skype installed in your Applications folder: user1 ALL=(user2) NOPASSWD: /Applications/Skype.app/Contents/MacOS/Skype You could consider adding Skype directly to the sudo's configuration file. If you run sudo -s that will start a shell as root. ![]() I have just seen your comment regarding Skype. Another way to switch to another account with sudo is to use the -s option. If you would like to run more commands, then add those commands (with full path) separated with a comma. ![]() In order to do both touch and ls as peeradmin user, the rule in /etc/sudoers file should look like: nagios ALL (peeradmin) NOPASSWD: /bin/ls, /bin/touch. If you want to be able to switch to any user just use user1 ALL=(ALL) NOPASSWD: /bin/bash Though correct, I think the above answer is a little incomplete. In order to do both touch and ls as peeradmin user, the rule in /etc/sudoers file should look like: nagios ALL (peeradmin) NOPASSWD: /bin/ls, /bin/touch If you would like to run more commands, then add those commands (with full path) separated with a comma. You can replace also /bin/bash by ALL and then you could launch any command as user2 without a password: sudo -u user2. Because this feature allows you to become another user, different from the user that logged into the machine (remote user), we call it become. 1 Though correct, I think the above answer is a little incomplete. So you navigate at the end of the file and add this: user1 ALL=(user2) NOPASSWD: /bin/bash This is where you need to add the new line. sudo allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file. This file is structured in different section, the aliases, then defaults and finally at the end you have the rules. You usually need super user privilege for visudo: sudo visudo First add the user, run: sudo adduser Add the user to sudo group by typing the command in terminal for Ubuntu version 12.04 and.Another command line editor sometimes regarded as easier is nano, so you would do export EDITOR=/usr/bin/nano. Note: this command will open the configuration using the vi text editor, if you are unconfortable with that, you need to set another editor (using export EDITOR=) before executing the following line. To configure sudo, you must edit its configuration file via: visudo. It needs a bit of configuration though, but once done you would only do this: sudo -u user2 -sĪnd you would be logged in as user2 without entering a password.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |