ssh-copy-id帮助

 SSH-COPY-ID()                                                                BSD General Commands Manual                                                                SSH-COPY-ID()

 NAME
ssh-copy-id — use locally available keys to authorise logins on a remote machine SYNOPSIS
ssh-copy-id [-f] [-n] [-i [identity_file]] [-p port] [-o ssh_option] [user@]hostname
ssh-copy-id -h | -? DESCRIPTION
ssh-copy-id is a script that uses ssh() to log into a remote machine (presumably using a login password, so password authentication should be enabled, unless you've done some
clever use of multiple identities). It assembles a list of one or more fingerprints (as described below) and tries to log in with each key, to see if any of them are already
installed (of course, if you are not using ssh-agent() this may result in you being repeatedly prompted for pass-phrases). It then assembles a list of those that failed to log
in, and using ssh, enables logins with those keys on the remote server. By default it adds the keys by appending them to the remote user's ~/.ssh/authorized_keys (creating the
file, and directory, if necessary). It is also capable of detecting if the remote system is a NetScreen, and using its ‘set ssh pka-dsa key ...’ command instead. The options are as follows: -i identity_file
Use only the key(s) contained in identity_file (rather than looking for identities via ssh-add() or in the default_ID_file). If the filename does not end in .pub this
is added. If the filename is omitted, the default_ID_file is used. Note that this can be used to ensure that the keys copied have the comment one prefers and/or extra options applied, by ensuring that the key file has these set as pre‐
ferred before the copy is attempted. -f Forced mode: doesn't check if the keys are present on the remote server. This means that it does not need the private key. Of course, this can result in more than one
copy of the key being installed on the remote system. -n do a dry-run. Instead of installing keys on the remote system simply prints the key(s) that would have been installed. -h, -? Print Usage summary -p port, -o ssh_option
These two options are simply passed through untouched, along with their argument, to allow one to set the port or other ssh() options, respectively. Rather than specifying these as command line options, it is often better to use (per-host) settings in ssh()'s configuration file: ssh_config(5). Default behaviour without -i, is to check if ‘ssh-add -L’ provides any output, and if so those keys are used. Note that this results in the comment on the key being the filename
that was given to ssh-add() when the key was loaded into your ssh-agent() rather than the comment contained in that file, which is a bit of a shame. Otherwise, if ssh-add()
provides no keys contents of the default_ID_file will be used. The default_ID_file is the most recent file that matches: ~/.ssh/id*.pub, (excluding those that match ~/.ssh/*-cert.pub) so if you create a key that is not the one you want
ssh-copy-id to use, just use touch(1) on your preferred key's .pub file to reinstate it as the most recent. EXAMPLES
If you have already installed keys from one system on a lot of remote hosts, and you then create a new key, on a new client machine, say, it can be difficult to keep track of
which systems on which you've installed the new key. One way of dealing with this is to load both the new key and old key(s) into your ssh-agent(1). Load the new key first,
without the -c option, then load one or more old keys into the agent, possibly by ssh-ing to the client machine that has that old key, using the -A option to allow agent forward‐
ing: user@newclient$ ssh-add
user@newclient$ ssh -A old.client
user@oldl$ ssh-add -c
... prompt for pass-phrase ...
user@old$ logoff
user@newclient$ ssh someserver now, if the new key is installed on the server, you'll be allowed in unprompted, whereas if you only have the old key(s) enabled, you'll be asked for confirmation, which is your
cue to log back out and run user@newclient$ ssh-copy-id -i someserver The reason you might want to specify the -i option in this case is to ensure that the comment on the installed key is the one from the .pub file, rather than just the filename
that was loaded into you agent. It also ensures that only the id you intended is installed, rather than all the keys that you have in your ssh-agent(1). Of course, you can
specify another id, or use the contents of the ssh-agent(1) as you prefer. Having mentioned ssh-add(1)'s -c option, you might consider using this whenever using agent forwarding to avoid your key being hijacked, but it is much better to instead use
ssh(1)'s ProxyCommand and -W option, to bounce through remote servers while always doing direct end-to-end authentication. This way the middle hop(s) don't get access to your
ssh-agent(1). A web search for ‘ssh proxycommand nc’ should prove enlightening (N.B. the modern approach is to use the -W option, rather than nc(1)). ENVIRONMENT
SSH_COPY_ID_LEGACY
If the SSH_COPY_ID_LEGACY environment variable is set, the ssh-copy-id is run in a legacy mode. In this mode, the ssh-copy-id doesn't check an existence of a private key
and doesn't do remote checks of the remote server versions or if public keys are already installed. SEE ALSO
ssh(1), ssh-agent(1), sshd(8) BSD March 15, 2019 BSD

Linux命令:ssh-copy-id的更多相关文章

  1. 菜鸟学Linux命令:ssh命令 远程登录

    1.查看SSH客户端版本 有的时候需要确认一下SSH客户端及其相应的版本号.使用ssh -V命令可以得到版本号.需要注意的是,Linux一般自带的是OpenSSH: 下面的例子即表明该系统正在使用Op ...

  2. 关于linux命令ssh的总结

    因为项目计算量比较大,需要将任务分布到多台电脑上面运行,因为对于分布式概念不熟,就想到了linux最简单的ssh协议,远程控制其他电脑,然后写shell脚本统一在所有电脑上运行程序.(我的操作系统为U ...

  3. Linux命令:ssh

    ssh介绍 ssh用法 ssh帮助 SSH() BSD General Commands Manual SSH() NAME ssh — OpenSSH SSH client (remote logi ...

  4. linux命令-ssh {远程登录}

    一 命令解释 命令: ssh ssh [-l login_name] [-p port] [user@]hostname

  5. 每天一个linux命令--ssh的host配置用户名密码

    1.在终端输入 cd ~/.ssh/ vi config 输入服务器的用户名和密码 souche@kickseed:~/.ssh$ cat config # 这是跳板机的配置,给跳板机的 IP 起个别 ...

  6. linux命令--ssh创建隧道

    工作应用场景 在工作中,总会连接到各种不能直接访问的环境,所以我们必须使用ssh隧道进行访问. 原理简介 ssh隧道:https://www.jianshu.com/p/20600c91e656

  7. linux下ssh远程登录/scp远程复制文件/rsync远程同步命令的自动登录

    最近需要写一个脚本备份各个服务器上的程序到一个指定服务器上,本来以为查查rsync命令的使用321就能搞定,结果rsync命令要支持自动登 录还是要配置服务和参数,又不确定网上说的配置的行不行,因为都 ...

  8. SSH Secure Shell Client连接Linux 命令行显示中文乱码问题 和oracle 查询数据中文乱码问题

    一.SSH Secure Shell Client连接Linux 命令行显示中文乱码问题 linux 设置系统语言 修改 /etc/sysconfig/i18n 文件,如 LANG="en_ ...

  9. Linux 使用 ssh 命令远程连接另一台 Linux

    用 Linux 系统的 ssh 命令远程连接另一台 Linux 机器的命令 #ssh 用户名@主机名(IP地址) 例: #ssh root@10.41.24.138                  ...

  10. Linux下用命令查看CPU ID以及厂家等信息

    Linux下用命令查看CPU ID // 获得CPU IDdmidecode -t 4 | grep ID |sort -u |awk -F': ' '{print $2}' // 获得磁盘IDfdi ...

随机推荐

  1. [UE4]实例化材质

    在虚幻引擎 4 中,材质实例化用来更改材质的外观,而不会引起成本高昂的材质重新编译. 实例化材质官方文档

  2. [UE4]响应鼠标点击

  3. JVM调优常用参数

    JVM常用参数配置 -Xmx2048m 最大堆大小 -Xms1024m 初始堆大小 -Xmn1024m 年轻代大小 -XX:SurvivorRatio=8 Eden区与Survivor区的大小比值,设 ...

  4. asp.net网站中增删文件夹会导致Session或cache等等丢失

    因为这会导致网站资源本身重新加载. 如果要改变文件和文件夹,一般应该是对 app_data 下进行操作.

  5. solr 打分和排序机制(转载)

    以下来自solr in action. 包含: 词项频次.查询词项出现在当前查询文档中的次数. 反向文档频次.查询词项出现在所有文档总的次数. 此项权重. 标准化因子: 字段规范: 文档权重. 字段权 ...

  6. Python NLTK——代码重用,F5运行py文件cmd闪退,invalid syntax

    打开IDLE,对代码进行保存(Ctrl+S)后,代码都是可以运行的. 但是打开文件就会弹出cmd并闪退,截了好几次图发现报的是Invalid syntax的错. 后来发现应该在IDLE中新建一个fil ...

  7. oracle取出多个字段列中的最大值和最小值

    greatest 函数和least函数 select serverid, greatest(e.core0, e.core1, e.score2 ) from e

  8. JIRA敏捷sprint需求统计设置

    1.JIRA->My Dashboard ->添加它的过滤条件 2.过滤条件产生,将sql拷贝至步骤1编辑的JQL中

  9. retry之python重试机制

    安装 pip install retry Retry装饰器 retry(exceptions=Exception, tries=-1, delay=0, max_delay=None, backoff ...

  10. java与xml转换 -- XStreamAlias

    @XStreamAlias 1.特点 简化的API; 无映射文件; 高性能,低内存占用; 整洁的XML; 不需要修改对象;支持内部私有字段,不需要setter/getter方法 提供序列化接口; 自定 ...