{"id":6063,"date":"2019-07-21T13:31:27","date_gmt":"2019-07-21T13:31:27","guid":{"rendered":"https:\/\/www.nemra-1.com\/?p=6063"},"modified":"2019-07-21T13:59:22","modified_gmt":"2019-07-21T13:59:22","slug":"how-to-create-a-sudo-admin-on-centos","status":"publish","type":"post","link":"https:\/\/www.nemra-1.com\/ar\/how-to-create-a-sudo-admin-on-centos.html","title":{"rendered":"How To Create a Sudo Admin on CentOS"},"content":{"rendered":"
The sudo<\/strong> command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on CentOS<\/span><\/strong>, without having to modify your server’s sudoers<\/span> <\/strong>file. If you want to configure sudo<\/span> for an existing user, simply skip to step 3.<\/p>\n Steps to Create a New Sudo User ssh root@server_ip_address<\/p><\/blockquote>\n Use the adduser command to add a new user to your system.<\/p>\n Be sure to replace username with the user that you want to create.<\/p>\n adduser username passwd username<\/p><\/blockquote>\n Set and confirm the new user’s password at the prompt. A strong password is highly recommended!<\/p>\n Set password prompts: Use the usermod command to add the user to the wheel group.<\/p>\n usermod -aG wheel username Test sudo access on new user account<\/p>\n Use the su command to switch to the new user account.<\/p>\n su – username<\/p><\/blockquote>\n As the new user, verify that you can use sudo by prepending “sudo” to the command that you want to run with superuser privileges.<\/p>\n sudo command_to_run<\/p><\/blockquote>\n For example, you can list the contents of the \/root directory, which is normally only accessible to the root user.<\/p>\n sudo ls -la \/root<\/p><\/blockquote>\n The first time you use sudo in a session, you will be prompted for the password of the user account. Enter the password to proceed.<\/p>\n Output: The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create…<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1233],"tags":[2135,2136,2134],"yoast_head":"\n
\nLog in to your server as the root user.<\/p>\n
\nUse the passwd command to update the new user’s password.<\/p>\n
\nChanging password for user username.
\nNew password:
\nRetype new password:
\npasswd: all authentication tokens updated successfully.<\/p><\/blockquote>\n
\nBy default, on CentOS, members of the wheel group have sudo privileges.<\/p><\/blockquote>\n
\n[sudo] password for username:
\nIf your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"