![]() ![]() ![]() Please do post your queries and feedback in below comments sections. Now, if we run admin commands via sudo then it will not prompt for the password. # echo -e "sysadm\tALL=(ALL)\tNOPASSWD: ALL" > /etc/sudoers.d/sysadm Run beneath echo command to complete above task, $ su. In case, you want to run sudo commands without password, then edit the sudoer files, comment out the line “ %wheel ALL=(ALL) ALL” and uncomment “ # %wheel ALL=(ALL) NOPASSWD: ALL” # vi /etc/sudoersĪlternate way to run sudo commands without password is that create a separate file with name like ‘ sysadm’ under the directory ‘ /etc/sudoers.d’ and add the following entry. If you have noticed carefully, we must specify password for executing admin commands via sudo. Output of above command would like below:Ībove confirms that user has sudo rights and can run admin commands. To confirm whether newly created user has sudo rights or not, run couple of admin commands and don’t forget to type sudo in front of commands.įirst switch to regular user or login with regular user and run following commands, # su - sysadm Create a new user account using the adduser command. ![]() First, log in to your system as the root user: ssh rootserveripaddress. Run beneath command to verify whether user is part of wheel group or not. If you want to configure sudo for an existing user, skip to step 3. Use following command to add an existing regular user to wheel group, Note: Replace the password string with the password that you want to set for the user. Let’s assume we want to create a user with name ‘sysadm’, run following useradd command # useradd -G wheel sysadmĪssign the password to above newly created user with beneath passwd command, # echo | passwd sysadm -stdin While creating a new regular user, specify ‘wheel’ as secondary group. Login to your system as root user or if you have logged-in as regular user switch to root user, use following command $ su - root 2) Create regular user with useradd command ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |