create user ubuntu command line

sudo adduser USERNAME
# choose password
# other fields can be left empty
sudo usermod -aG sudo USERNAME

# change user to check if everything is ok
su - USERNAME
whoami
#  output > USERNAME
sudo whoami
# output > root or an error

# if error switch back to the other account
# and do the following to modify /etc/sudoers

sudo visudo
# find a line like "root ALL=(ALL:ALL) ALL" (or similar)
# add an identical line for USERNAME, like
# "USERNAME ALL=(ALL:ALL) ALL"
Ctrl+O, Ctrl+X  # save and exit
# change user to check if everything is ok

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
cli ubuntu create user ubuntu create user command line home directory create user in ubuntu how to register to the username from terminal in ubuntu create a user ubuntu add user ubuntu command line create user ubuntu after installation ubuntu how to add a user how to create a new user on ubuntu ubuntu user add how to create user server ubuntu how create new user ubuntu make user in ubuntu new user ubuntu create a new user in ubuntu command line add new user ubuntu create new user in ubuntu how add user ubuntu how to add new user in ubuntu ubuntu add user make new user on ubuntu ubuntu create user cli make user ubuntu ubuntu add user terminal create a user on ubuntu create another user ubuntu ubuntu create new user from terminal ubuntu use user ubuntu create user with directory create user ubuntu command add new user in ubuntu how to create new user on ubuntu terminal ubuntu add new user how to create a new user in ubuntu how to make a new user ubuntu how to add user ubuntu ubuntu server add user make new user in ubuntu create a user in ubuntu create a new user in ubuntu create ubuntu user ubuntu create user with home ubuntu make new user create new user in ubuntu terminal create user account ubuntu create an ubuntu user Creating Users on ubuntu server command how to open new user in linux ubuntu how to make new user in ubuntu ubuntu creat user create user ubuntu 16.04 create user ubuntu command line ubuntu server create user ubuntu make user ubuntu add a new user how to create another user in ubuntu server make user administrator ubuntu ubuntu create a new user add use ubuntu add user to ubuntu create add a user ubuntu server how to create new user ubuntu ubuntu how to make a new user create sudo user ubuntu add user ubuntu with sudo linux ubuntu add user create new user on ubuntu how to change user in ubuntu terminal create ssh user ubuntu ubutnu add user create user on ubuntu ubuntu server create new user ubuntu make new user account terminal ubuntu creating user ubuntu new user ubuntu create new user how to create a new user in ubuntu server ceration of user account in ubuntu terminal create user command line ubuntu make user on ubuntu server ubuntu how to create second user add user ubuntu create a new user ubuntu how to create a user on ubuntu ubuntu add user command line create user in ubuntu server linux create user ubuntu command line create new user ubuntu make new user ubuntu ubuntu add user ubuntu create user create user ubuntu
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source