ssh-copy-id 命令的 man 说明文档

说明文档比较简单,就不再赘述翻译了

SSH-COPY-ID(1)                                                  SSH-COPY-ID(1)NAMEssh-copy-id - install your public key in a remote machine’s authorized_keysSYNOPSISssh-copy-id [-i [identity_file]] [user@]machineDESCRIPTIONssh-copy-id  is a script that uses ssh to log into a remote machine (presumably using a login password, so password authenti-cation should be enabled, unless you’ve done some clever use of multiple identities) It also changes the permissions  of  theremote  user’s  home,  ~/.ssh, and ~/.ssh/authorized_keys to remove group writability (which would otherwise prevent you fromlogging in, if the remote sshd has StrictModes set in its configuration).  If the -i option is given then the  identity  file(defaults  to  ~/.ssh/id_rsa.pub)  is used, regardless of whether there are any keys in your ssh-agent.  Otherwise, if this:ssh-add -L provides any output, it uses that in preference to the identity file.  If the -i option is used,  or  the  ssh-addproduced no output, then it uses the contents of the identity file.  Once it has one or more fingerprints (by whatever means)it uses ssh to append them to ~/.ssh/authorized_keys on the remote machine (creating the file, and directory, if necessary)SEE ALSOssh(1), ssh-agent(1), sshd(8)OpenSSH                        14 November 1999                 SSH-COPY-ID(1)

使用示例

[root@localhost .ssh]# ssh-copy-id -i id_rsa.pub root@93.xx.xx.xx -p 27073
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "id_rsa.pub"
The authenticity of host '[93.xx.xx.xx]:27073 ([93.xx.xx.xx]:27073)' can't be established.
RSA key fingerprint is SHA256:uTxnRGKSmlgPgUD8Qaerf7Hgun0V7PLc5kKoHKnj3JI.
RSA key fingerprint is MD5:6b:0d:59:9e:e0:c5:c2:95:99:2a:c0:a4:b1:4c:af:a0.
Are you sure you want to continue connecting (yes/no)? yes
/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
root@93.xx.xx.xx's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh -p '27073' 'root@93.xx.xx.xx'"
and check to make sure that only the key(s) you wanted were added.

登录测试

ssh -p ‘27073’ ‘root@93.xx.xx.xx’
通过上面命令,不用输入密码直接可以登录目标服务器

Linux命令 ssh-copy-id 使用方法(将ssh 公钥上传到目标服务器进行免密登录)相关推荐

  1. 设备远程连接—安卓端连接linux云服务器以及免密登录配置

    1.下载Termux 下载地址 2.pkg 命令执行软件安装 在安卓机上成功安装Termux后,我们进入Termux使用pkg命令进行软件安装 订阅附加仓库 root-repo :pkg instal ...

  2. curl post https_Linux命令cURL详解,并实现文件定时上传到ftp服务器的程序

    前言 前段时间群里讨论,想实现某个文件定时上传到服务器要怎么来实现.我记得之前做过 一个项目:为高通的iot模组编写FOTA功能:实现模组可以远程下载升级镜像包,实现版本升级功能.并当时使用的一个超级 ...

  3. Linux ssh免密登录

    linux跨服务器命令调用(scp,ssh等)都需要输入密码, 为了使一键安装脚本能够更顺畅, 设置免密登录是必要的. 下面列出步骤(参考自: 来源): 主要原理 在A上创建一对公私钥 (公钥文件:~ ...

  4. Linux 实现ssh免密登录--设置后不生效的处理办法

    登录Linux进入/home/app/.ssh/目录下 执行ssh-keygen -t rsa 创建密钥,一直回车即可,因为是免密所以直接回车略过:执行完之后会在/root/.ssh/下生成两个文件i ...

  5. linux关于ssh免密登录、known_hosts文件

    1. 关于ssh SSH 是 Secure Shell 的缩写,SSH 为建立在应用层基础上的安全协议.SSH 是目前广泛采用的安全登录协议,专为远程登录会话和其他网络服务提供安全性的协议,替代以前不 ...

  6. 玩转 ssh 免密登录配置:使用两个环境模拟配置成功和其他几种失败的情况

    一.引言 最近在工作中,我遇到了这么一个需求: 我们需要每天给客户环境发送一个打包文件,对此,客户环境提供了一个 sftp 服务来接收我们的文件 这是一个非常简单的需求场景,但是这个需求对于我项目的要 ...

  7. Linux之RHCE免密登录及HTTP详解

    目录 1.实现免密登录 1.进入目录 2.产生公钥私钥 3. 创建信任 4.免密登录 ​2.设置只允许student1, student2用户登录 1.创建student1和student2并设置密码 ...

  8. scp免密登录,同时也适应ssh免密登录

    环境: 主机A:windows 主机B:linux     IP地址:192.168.0.110 目标: 实现把主机A上的文件复制到主机B上,并在下次是免密登录. 实现方法:  第一步: 在主机A上创 ...

  9. Linux 实现密钥免密登录

    环境:CentOS 7 一.创建密钥 登录Linux进入/root/.ssh/目录下 没有生成密钥的目录如下 执行ssh-keygen -t rsa 创建密钥,一直回车即可,红框是输入密码,因为是免密 ...

最新文章

  1. C/C++结构体四字节数据对齐
  2. cmd怎么运行http_Scrapy源码剖析(二)Scrapy是如何运行起来的?
  3. Linux shell中的一个问题 ${}带正则匹配的表达式
  4. [转]iPhone本地化总结
  5. 也谈莫言荣获诺贝尔文学奖后我的“低调”
  6. .Net Core 商城微服务项目系列(一):使用IdentityServer4构建基础登录验证
  7. mysql 创建表单
  8. GDB 调试命令讲解 2-转
  9. 【动态规划】计蒜客:跳木桩(最长递增子序列的变体)
  10. cron表达式每隔1小时一次_quartz 每天 8-10点每隔10分钟执行一次,11-13点每隔1小时执行一次 cronExpression 要怎么写?...
  11. 路由器和交换机哪个更好?路由器交换机怎么连接?
  12. 利用C语言编程输出小写英文字母表的大写形式(以5为间隔)
  13. LANTENNA:通过以太网电缆泄露,从物理隔离网络中窃取数据
  14. scrapy爬取彼岸图网照片(搜索关键字,去重)
  15. 墨盒和墨仓打印机区别?
  16. DS90UB953-Q1-DS90UB954-Q1调试记录
  17. 第5周编程题在线测试
  18. 曲面研究的两个基本问题、旋转曲面、柱面、二次曲面
  19. vsc编辑器设置背景图
  20. 【C初阶】第一篇——初识C语言(万字篇,带你敲响C语言的大门)

热门文章

  1. excel表格怎么转换成php格式转换,xls怎么转换成word格式
  2. android -- ContextMenu 的使用 和 OptionsMenu 区别
  3. 3DMax广告海报立体字效果制作
  4. linux内核快速倒车,初探Linux内核态——通过proc文件系统作快速问题定位
  5. 荣耀战魂冥界回归服务器维护,血月凌空!《荣耀战魂》万圣节活动“冥界的回归”现已开启...
  6. Proxmox VE(PVE)安装LEDE/OpenWrt
  7. ArcGIS9.3 桌面版扩展模块无法使用
  8. chatgpt赋能python:Python中的立方根-一种快速简便的计算方法
  9. Android学习小记-----拦截电话/拒接电话,规避拒接电话前响一声或者两声的问题...
  10. web技术分享| 快速实现一个呼叫邀请 SDK