Aliyun
ssh root@ip [-p 22]
adduser user
usermod -aG sudo user
# Log in with the created user
ssh user@ipEstablish passwordless login, if the directory or file doesn’t exist, create it.
Host serverAlias
Hostname ip
User userGenerate a key if not available and copy it to the server.
If already present, copy directly.
# Generating a key can be done with default settings
ssh-keygen
ssh-copy-id serverAliasNow, logging in is as simple as using the specific alias with serverAlias.
ssh serverAliasAWS
chmod 400 xx.pem
ssh -i "xx.pem" ubuntu@ipTo enable password login.
# Set a password for the default user
sudo passwd ubuntu
sudo vi /etc/ssh/sshd_config
# Change no to yes
PasswordAuthentication yes
# Save, exit and restart the service
sudo service sshd restartThen, log in with sudo ubuntu@ip (or configure passwordless login similar to the Alibaba Cloud instructions above).