1. AddUser
[email protected]:~# adduser lwkperl:warning:Setting locale failed.perl:warning:Please Check that your locale set Tings:language = (unset), Lc_all = (unset), Lc_paper = "ZH_CN. UTF-8 ", lc_address =" ZH_CN. UTF-8 ", lc_monetary =" ZH_CN. UTF-8 ", lc_numeric =" ZH_CN. UTF-8 ", Lc_telephone =" ZH_CN. UTF-8 ", lc_identification =" ZH_CN. UTF-8 ", lc_measurement =" ZH_CN. UTF-8 ", Lc_name =" ZH_CN. UTF-8 ", LANG =" en_US. UTF-8 "is supported and installed on your system.perl:warning:Falling the back to a fallback locale (" en_US. UTF-8 "). Adding user ' Lwk ' ... Adding new group ' Lwk ' (1001) ... Adding new user ' Lwk ' (1001) with group ' Lwk ' ... Creating home directory '/home/lwk ' ... Copying files from '/etc/skel ' ... Enter new Unix Password:retype new Unix Password:passwd:password updated successfullychanging the user information for Lwkenter the new value, or press ENTER for the default full Name []: Lwk. Number []: Work Phone []: Home Phone []:Other []: is the information correct? [y/n] [email protected]:~#
2.sudo Permissions
usermod -a -G sudo lwk
3.install Openssh-server
[email protected]:~# apt install openssh-server
4. Add the local public key to the remote server
[email protected] ~ $ ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
If you have previously logged in to the remote server with the current key, you need to remove the old remote server list locally with the following command
[email protected] ~ $ ssh-keygen -f "/home/lwk/.ssh/known_hosts" -R 192.168.1.25
5. SSH Login
[email protected] ~ $ ssh [email protected]Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support:
Ubuntu Server 16.04 lts initialization