要执行远程的命令
ssh root@192.168.154.128 ' bash -x -s ' < /data/tom.sh
执行命令
ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/wangan/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/wangan/.ssh/id_rsa.
Your public key has been saved in /home/wangan/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:+67hldI2SF6SNxZCask7C91b3Uq7R1+KoCXSb2K46mM wangan@localhost.localdomain
再执行命令
ssh-copy-id -i /home/wangan/.ssh/id_rsa.pub 192.168.154.129