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. Linux配置IP,安装yum源

    ip addr 查看IP地址 通过 ip 命令加参数 addr 则是查看当前网卡的配置信息, 从下图中可以看出, 当前系统的 ens33 网卡并没有 ipv4 及 ipv6, 没有 ip地址 则只能说 ...

  2. 使用CacheCloud管理Redis实例

    转载来源:http://www.ywnds.com/?p=10610 一.CacheCloud是什么? 最近在使用CacheCloud管理Redis,所以简单说一下,这里主要说一下我碰到的问题.Cac ...

  3. keras的LSTM函数详解

    keras.layers.recurrent.LSTM(units, activation='tanh', recurrent_activation='hard_sigmoid', use_bias= ...

  4. (转)MTU&MSS

    MTU是Maximum Transmission Unit的缩写,意为最大传输单元,通俗的理解就是在网络上传送的最大数据包,单位是字节. 以太网对数据帧的长度都有一个限制,其最大值为1500,这个特性 ...

  5. flume用场景及架构原理

    Flume是什么 1.flume可以将采集到的数据存储到HDFS上,也可以放在Hbase上. 2.flume就是一个中间插件,他的作用就是屏蔽数据源和数据存储系统的差异.可以在不同的数据源采集数据,因 ...

  6. hive计算周一的日期

    ) FreeMarker --',-7)?date('yyyy-MM-dd'),'week')?string('yyyy-MM-dd')}'

  7. Spring MVC与注解相关的一些配置的方法

    在spring mvc中,注解是需要通过配置文件去开启的,一般简单的项目可分为两个配置文件,这里姑且叫做spring-mvc.xml与spring-context.xml.其中spring-mvc.x ...

  8. CentOS、Ubuntu、Debian简析

    Centos .Ubuntu.Debian 三个Linux都是非常优秀的系统,开源的系统,也分付费的商业版和免费版,下面简单比较这三种系统. Centos系统 非常多的商业公司部署在生产环境上的服务器 ...

  9. 前端(慕课网)笔记二:http协议

    缓存 cors 1.http协议的主要特点: 简单快速:每个资源URI是固定的: 灵活:通过一个协议完成不同数据格式的传输 无连接:连接一次就会断开,不会保持连接 无状态:客服端和服务端是两种身份,客 ...

  10. javafx自动补全

    public boolean showUpload2HomeDialog(final OperationInfo initDataInfo) { boolean result = false; try ...