侧边栏壁纸
博主头像
WinJay博主等级

博观而约取 厚积而薄发

  • 累计撰写 333 篇文章
  • 累计创建 168 个标签
  • 累计收到 2 条评论

目 录CONTENT

文章目录

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

WinJay
2019-08-04 / 0 评论 / 0 点赞 / 80 阅读 / 1,044 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-01-20,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
[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

评论区