Showing posts with label User. Show all posts
Add User and Grant Root Privileges on Ubuntu. This tutorial we will learn how to Add user and grant root privileges so you could send command like a root user. Before starting, you should be logged as root user. Add a user
adduser demo
It will prompt you to enter the user details. Its optional. You can press [enter] till the last to skip Grant root privilege to demo user
visudo
Find the following code and paste the 3rd line
# User privilege specification
root ALL=(ALL:ALL) ALL
demo ALL=(ALL:ALL) ALL
Save the changes by pressing ctrl+o and exit ctrl+x You can now run command as root by using the command sudo following the command. Example :
sudo chmod 777 test_folder
sudo visudo
Ubuntu: Delete (remove) a user on Linux Ubuntu server. Before starting to this tutorial, you should be on root user first. Now do the following command:
userdel demo
Or if you want to remove the user files then use command:
userdel -r demo
If the user has root privileges, you may wish to remove it.
visudo
Find the following code
# User privilege specification
root ALL=(ALL:ALL) ALL
demo ALL=(ALL:ALL) ALL
Remove the 3rd line. You should see only root:
# User privilege specification
root ALL=(ALL:ALL) ALL
Save the changes by pressing ctrl+o and exit ctrl+x
Copyright © 2012 My Linux Code