arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make new user and Delete a user and grant the user with sudo priviliges
#1
Hello guys,
Today I'll show you how to create a new user.The reason for creating a new user rather than using root is that using root as the main user can cause security risks secondly if several people are using your VPS you will have to make other users too.
When you perform any root tasks with the new user, you will need to use the word “sudo” before the command. This is a helpful command for 2 reasons:
1) it prevents the user making any system-destroying mistakes
2) it stores all the commands run with sudo to a file where can be reviewed later if needed.
Remember : that sudo is as powerful as the root user. If you only need a user for a limited number of tasks on the VPS, you do not need to give them root privileges.
Requirements :
This tutorial requires access to the root user or a user with sudo privileges.
Secondly This TUT works for Ubuntu, It may work on other too.
TUT :
To add a new user in Ubuntu, use the adduser command, replacing the “username” with your preferred username.
sudo adduser username
As soon as you type this command, Ubuntu will automatically start the process:
  • Type in and confirm your password
  • Enter in the user’s information. This is not required, pressing enter will automatically fill in the field with the default information
  • Press Y (or enter) when Ubuntu asks you if the information is correct
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 The New User with Root Privileges :
You can create the sudo user by opening the sudoers file with this command:
sudo /usr/sbin/visudo
Adding the user’s name and the same permissions as root under the the user privilege specification will grant them the sudo privileges.You must replace "username" with the name of your new user user created
# User privilege specification
root ALL=(ALL:ALL) ALL
username ALL=(ALL:ALL) ALL
Now Press Esc and then write :
:wq
After writing that press Enter and you'll pop back to your console.Now your new username has been granted with root privileges.
How To Delete the new user afterwards :
]If you think that you no longer want to have a specific user on the vps then you can delete them with a single command:
sudo userdel username
Finish up by the deleting the user’s home directory:
sudo rm -rf /home/newuser
And That's It! If you need any help then contact me.If you got some new information from my tutorial then please give me a +1 Smile



person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting