Home » Categories » Multiple Categories |
How To Add and Delete Users on Ubuntu 12.04 and CentOS 6 |
Article Number: 161 | Rating: Unrated | Last Updated: Sun, Jan 5, 2014 at 8:59 PM
|
When you log into a new freshly spun up server instance, you
are accessing it from the root user. Although this gives you the power to make
any changes you need on the server, you are much better off creating another
new user with root privileges on the virtual private server. Additionally, if
other people will be accessing the virtual server, you will need to make new
users for them as well. This tutorial will go over creating a new user,
granting them root privileges, and deleting users. Setup This tutorial requires access to the
root user or a user with sudo privileges. Users on Ubuntu 12.04 How to Add a User on Ubuntu 12.04 To add a new user in Ubuntu, use the adduser command, replacing the "newuser” with your preferred username. sudo adduser newuser
Congratulations—you have just added a new user. You can log out of the root user by typing exit and then logging back in with the new username and password. How to Grant a User Root Privileges As mentioned earlier, you are much
better off using a user with root privileges. sudo /usr/sbin/visudo
# User privilege specification root ALL=(ALL:ALL) ALL newuser ALL=(ALL:ALL) ALL
How to Delete a User Should you find that you find that you no longer want to have a specific user on the virtual private server you can delete them with a single command. sudo userdel newuser
sudo rm -rf /home/newuser Users on CentOS 6 How to Add a User on CentOS 6 To add a new user in CentOS, use the adduser command, replacing the "newuser” with your preferred username. sudo adduser newuser
sudo passwd newuser
How to Grant a User Root Privileges As mentioned earlier, you are much
better off using a user with root privileges. sudo /usr/sbin/visudo
## Allow root to run any commands anywhere root ALL=(ALL) ALL newuser ALL=(ALL) ALL
How to Delete a User Should you find that you find that you no longer want to have a specific user on the virtual private server you can delete them with a single command. sudo userdel newuser
sudo userdel -r newuser Next Steps Once you have set up the users will you need, you can start building up your server. A good place to start is to install the LAMP stack (a collection of basic web server software) on your server instance, using the tutorials below. |
Attachments
![]()
There are no attachments for this article.
|
How To Create Nagios Plugins With Bash On Ubuntu 12.10
Viewed 2304 times since Sat, Jan 4, 2014
How To Create Nagios Plugins With Perl On Ubuntu 12.10
Viewed 2473 times since Sat, Jan 4, 2014
How To Use the Web2py Framework to Quickly Build Your Python App
Viewed 4866 times since Sat, Jan 4, 2014
How To Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 6
Viewed 6715 times since Thu, Dec 26, 2013
How To Setup ownCloud 5 On Ubuntu 12.10
Viewed 5919 times since Sat, Jan 4, 2014
How To Set Up Python 2.7.6 and 3.3.3 on CentOS 6.4
Viewed 7623 times since Sat, Jan 4, 2014
How To Create Nagios Plugins With Perl On CentOS 6
Viewed 2731 times since Sat, Jan 4, 2014
How To Create Nagios Plugins With Ruby On CentOS 6
Viewed 3083 times since Sat, Jan 4, 2014
How To Install Nagios On Ubuntu 12.10
Viewed 2798 times since Sat, Jan 4, 2014
Docker Explained: How To Containerize Python Web Applications
Viewed 4813 times since Sat, Jan 4, 2014
|