Forem

Long Nguyễn Xuân
Long Nguyễn Xuân

Posted on

tạo 1 sudo user trong Ubuntu CLI

1- login vào server bằng account có quyền sudo

$ ssh root@$server_ip_address 
Enter fullscreen mode Exit fullscreen mode

2- tạo 1 user account

$ sudo adduser $USERNAME

# sẽ có thông tin bắn ra đại loại thế này 
# Adding user `username' ...
# Adding new group `username' (1001) ...
# Adding new user `username' (1001) with group `username' ...
# Creating home directory `/home/username' ...
# Copying files from `/etc/skel' ...
# New password:
# Retype new password:
# passwd: password updated successfully
# Changing the user information for username
# Enter the new value, or press ENTER for the default
#     Full Name []:
#     Room Number []:
#     Work Phone []:
#     Home Phone []:
#     Other []:
# Is the information correct? [Y/n]
Enter fullscreen mode Exit fullscreen mode

3- add user này vào nhóm sudo

$ sudo usermod -aG sudo $USERNAME
Enter fullscreen mode Exit fullscreen mode

backlink

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay