侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 446 篇文章
  • 累计创建 182 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

ssh-copy-id 非默认端口使用方法

WinJay
2019-08-04 / 0 评论 / 0 点赞 / 144 阅读 / 1383 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。
[root@Applets .ssh]# ssh-copy-id -i id_rsa.pub "-p 65080 git@172.17.136.248"      //不应该加引号的
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "id_rsa.pub"
Usage: /usr/bin/ssh-copy-id [-h|-?|-f|-n] [-i [identity_file]] [-p port] [[-o <ssh -o options>] ...] [user@]hostname
        -f: force mode -- copy keys without trying to check if they are already installed
        -n: dry run    -- no keys are actually copied
        -h|-?: print this help

[root@Applets .ssh]# ssh-copy-id -i id_rsa.pub -p 65080 git@172.17.136.248               //正确命令

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "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: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
git@172.17.136.248's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh -p '65080' 'git@172.17.136.248'"           
and check to make sure that only the key(s) you wanted were added.
[root@Applets .ssh]# ssh -p 65080 git@172.17.136.248
Last login: Sun Aug  4 11:37:46 2019

Welcome to Alibaba Cloud Elastic Compute Service !     //免密登录成功
0

评论区