安装

sudo apt install openssh-server
dpkg -l | grep ssh
ps -e | grep ssh

启动和停止

sudo /etc/init.d/ssh start
sudo service ssh start
sudo /etc/init.d/ssh stop

配置文件

/etc/ssh/sshd_config

登录

ssh michael@192.168.0.101
exit

生产密钥对

# algorithms DSA, RSA, ECDSA, or Ed25519 can be specified
ssh-keygen -t rsa

复制公钥到远程服务器

sudo ssh-copy-id -i .ssh/id_rsa.pub michael@192.168.0.104

sign_and_send_pubkey: signing failed: agent refused operation

eval "$(ssh-agent -s)"
ssh-add