![]() ![]() This script will do nothing except it will print process ID of the sudo_test.sh bash script along with its relevant owner id as a STDOUT output and in the same time it will create a file called sudo_file.tmp within /tmp/ directory. # echo "touch /tmp/sudo_file.tmp" > sudo_test.sh The following linux commands will create bash script called sudo_test.sh within /usr/local/bin directory and make it executable: $ su. Let’s create some simple bash script which will provide us with a basic testing environment for a sudo command. # apt-get install sudoįor yum ( RPM ) distributions use this command to install sudo: # yum install sudo NOTE: it is very unlikely that sudo utility is not installed on your system as most of the decent Linux distributions have the sudo utility installed by default. In case you are running Debian execute a following linux command to install sudo utility: This is very unlikely If you are running Ubuntu, Fedora or OpenSuSE as a sudo utility is installed on your system by default. If you had some problems when executing above commands the chances are that sudo is not installed on your system. Only user root and users which belong to a root group are able to read this file. Note the default and “must be” permissions of a /etc/sudoers file. You can use ls command to locate this file. The sudo configuration file sudoers is in most cases located in /etc/sudoers. ![]() ![]() The first command should reveal a location of a sudo binary executable and the second program will output a version number of sudo command its self. sudo installįirst we need to make sure that sudo and /etc/sudoers the sudo configuration file is available. This short article describes some basic of sudo usage and format of sudoers configuration file. This utility is very widely used but at the same time very little understood by Linux users of all levels. In this case a sudo utility with its /etc/sudoers configuration file will be your friend. For example, you may want an user john to run a find command or custom bash shell script as an user greg or even as a user root ( superuser ) without password exchange. What if you want one user to run a command as an another system user without exchanging passwords. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |