如下 需要做一个 3000端口的免密登录 还是传统的配方 还是原来的味道 但是报错了 不行
[username@localhost ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa):
/home/username/.ssh/id_rsa already exists.
Overwrite (y/n)?
[username@localhost ~]$ ssh-copy-id -p 3000 -i ~/.ssh/id_rsa.pub username@172.16.0.247
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/username/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: ERROR: ssh: connect to host 172.16.0.247 port 3000: Connection refused
正确姿势 如下
[username@localhost ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub -p3000 username@172.16.0.247
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/username/.ssh/id_rsa.pub"
The authenticity of host '172.16.0.247 (172.16.0.247)' can't be established.
ECDSA key fingerprint is SHA256:HBk6Q7eZtLtMzxeOKFgLnrmv1581RMQ2ywzH25LV2lg.
ECDSA key fingerprint is MD5:ff:82:60:72:1e:f2:5d:3a:77:c5:ae:7b:2c:51:1a:3f.
Are you sure you want to continue connecting (yes/no)?