SSH配置相关

更新于 2024-05-14

ssh服务器公钥默认保存位置

~/.ssh/authorized_keys

echo "xx" >> ./authorized_keys

ssh服务器配置

/etc/ssh/sshd_config

PermitRootLogin yes  #设置yes才允许密码登录
PubkeyAuthentication yes #开启公钥登录
PasswordAuthentication yes #开启密码登录

ssh-keygen -A #为服务器生成hostkeys:RSA/ECDSA/ED25519

scp命令

scp ./file1.png root@192.168.1.12:/home/

scp ./file1.png ./file2.png ./file3.png root@192.168.1.12:/home/

scp root@192.168.1.12:/home/\{./file1.png,./file2.png,./file3.png\} ./

-r参数递归上传