Revisions
- January 4, 2018 @ 16:41:54 [Current Revision] by Sharing Solution
- January 4, 2018 @ 16:41:54 by Sharing Solution
- January 4, 2018 @ 16:40:48 by Sharing Solution
- January 4, 2018 @ 16:40:10 by Sharing Solution
- January 4, 2018 @ 16:39:11 [Autosave] by Sharing Solution
- January 4, 2018 @ 16:36:03 by Sharing Solution
Revision Differences
January 4, 2018 @ 16:40:10 | Current Revision | ||
---|---|---|---|
Content | |||
Deleted: The | Added: 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 a new user with sudo access on CentOS, without having to modify your server's sudoers file. If you want to configure sudo for an existing user, simply skip to step 3. | ||
Deleted: <h2 id="steps-to- create-a-new- sudo-user">Steps to Create a New Sudo User</h2> | |||
Deleted: <ol> | |||
Added: Steps to Create a New Sudo User | |||
Deleted: | Added: Log in to your server as the root user. | ||
Deleted: ssh root@<span class="highlight" >server_ip_address</span></li> | Added: <strong>ssh root@server_ip_ address</strong> | ||
Deleted: <li>Use the <code>adduser< /code> command to add a new user to your system.Be sure to replace <span class="highlight" >username</span> with the user that you want to create | |||
Added: Use the adduser command to add a new user to your system. | |||
Added: Be sure to replace username with the user that you want to create. | |||
Added: adduser<strong> username | |||
Added: </strong> | |||
Added: Use the passwd command to update the new user's password. | |||
Deleted: adduser <span class="highlight" >username</span> | Added: passwd<strong> username</strong> | ||
Deleted: Use the <code>passwd< /code> command to update the new user's password.passwd <span class="highlight" >username</span></li> | |||
Deleted: <li> | |||
Deleted: <ul> | |||
Deleted: | Added: Set and confirm the new user's password at the prompt. A strong password is highly recommended! | ||
Deleted: Set password prompts: | |||
Deleted: <pre class="code-pre "><code>Changing password for user username. | |||
Deleted: New password: | |||
Deleted: Retype new password: | |||
Deleted: passwd: all authentication tokens updated successfully. | |||
Deleted: </code></pre> | |||
Deleted: </li> | |||
Deleted: </ul> | |||
Deleted: </li> | |||
Deleted: | Added: Use the usermod command to add the user to the wheel group. | ||
Deleted: usermod | Added: usermod<strong> -aG wheel username</strong> | ||
Deleted: By default, on CentOS, members of the | Added: By default, on CentOS, members of the wheel group have sudo privileges. | ||
Deleted: | Added: Test sudo access on new user account | ||
Deleted: <ul> | |||
Deleted: | Added: Use the su command to switch to the new user account. | ||
Deleted: su - <span class="highlight">username | |||
Added: su<strong> - username</strong> | |||
Deleted: | Added: As the new user, verify that you can use sudo by prepending "sudo" to the command that you want to run with superuser privileges. | ||
Deleted: sudo <span class="highlight" >command_to_run | Added: sudo<strong> command_to_run</strong> | ||
Deleted: | Added: For example, you can list the contents of the /root directory, which is normally only accessible to the root user. | ||
Deleted: sudo ls -la /root | |||
Added: sudo<strong> ls -la /root</strong> | |||
Deleted: | Added: 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. | ||
Unchanged: Output: | Unchanged: Output: | ||
Deleted: | Added: [sudo] password for username: | ||
Deleted: </code></pre> | |||
Deleted: If 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. | Added: If 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. | ||
Deleted: </ul> | |||
Deleted: </li> | |||
Deleted: </ol> |
Note: Spaces may be added to comparison text to allow better line wrapping.
Hello! Would you mind if I share your blog with my zynga group? There’s a lot of people that I think would really enjoy your content. Please let me know. Thanks
Hi, it is fine for me 🙂