uTools-Manuals/docs/linux/ssh-copy-id.html
2019-04-21 11:50:48 +08:00

14 lines
967 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="ssh-copy-id">ssh-copy-id</h1>
<p>把本地的ssh公钥文件安装到远程主机对应的账户下</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>ssh-copy-id命令</strong> 可以把本地主机的公钥复制到远程主机的authorized_keys文件上ssh-copy-id命令也会给远程主机的用户主目录home<code>~/.ssh</code>, 和<code>~/.ssh/authorized_keys</code>设置合适的权限。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">ssh-copy-id [-i [identity_file]] [user@]machine</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-i指定公钥文件</code></pre>
<h3 id="实例">实例</h3>
<p>1、把本地的ssh公钥文件安装到远程主机对应的账户下</p>
<pre><code class="language-bash">ssh-copy-id user@server
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->