DEV Community

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)