In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The sudo command allows us to run any command or selected command as a system administrator. Environment
Deepin 15.11
Create a new user
Use adduser to create a user with the user name user01
Bob@bob-PC:~$ sudo adduser user01Adding user `user01'... Adding new group `user01' (1001)... Adding new user `user01' (1001) with group `user01'... Creating home directory `/ home/user01'... Copying files from` / etc/skel'... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfullyChanging the user information for user01Enter the new value Or press ENTER for the default Full Name []: user01 Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] Y
Add the user user01 to the sudo group
All members of the sudo group grant sudo and root access on the Deepin system. Therefore, to add the user01 user you just created to the sudo group, run the following command:
Bob@bob-PC:~$ sudo adduser user01 sudoAdding user `user01' to group `sudo'... Adding user user01 to group sudoDone.
Use the id command to see if the user has been added to the sudo group
Bob@bob-PC:~$ id user01uid=1001 (user01) gid=1001 (user01) groups=1001 (user01), 27 (sudo) test sudo user account
Now user01 users log in to the native test using ssh
Bob@bob-PC:~$ ssh user01@localhostThe authenticity of host 'localhost (127.0.0.1)' can't be established.ECDSA key fingerprint is SHA256:TKkqZwt9OzPaVSwSkFoLXtAFwnU4aKMG7T8QyF2fPKw.Are you sure you want to continue connecting (yes/no)? YesWarning: Permanently added 'localhost' (ECDSA) to the list of known hosts.user01@localhost's password: Welcome to Deepin 15.11 GNU/Linux * Homepage: https://www.deepin.org/ * Bugreport: https://feedback.deepin.org/feedback/* Community: https://bbs.deepin.org/user01@bob-PC:~$
Check to see if sudo works:
User01@bob-PC:~$ ls-l / rootls: cannot open directory'/ root': Permission denieduser01@bob-PC:~$ sudo ls-l / root [sudo] password for user01: total 4drwxr-xr-x 2 root root 4096 Mar 6 18:05 template
How to use sudo to execute commands
Examples of use:
Sudo [option] command sudo-I sudo-s sudo systemctl restart networking sudo tail-f / var/log/boot.log how to delete the specified user user01@bob-PC:~$ sudo deluser user01 sudoRemoving user `user01' from group `sudo'... Done.# from the sudo group to see if the user is not in the sudo group user01@bob-PC:~$ id user01uid=1001 (user01) gid=1001 (user01) groups=1001 (user01)
How to delete a user:
Bob@bob-PC:~$ sudo deluser-- remove-home user01Looking for files to backup/remove... Removing files... Removing user `user01'... Warning: group `user01' has no more members.Done. Summary
The sudo command allows us to run any command or selected command as a system administrator.
Original address: https://www.linuxprobe.com/deepin-create-sudo-user.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.