自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

scp在Linux主機(jī)之間復(fù)制不用輸入密碼

系統(tǒng) Linux
把你的本地主機(jī)用戶的ssh公匙文件復(fù)制到遠(yuǎn)程主機(jī)用戶的~/.ssh/authorized_keys文件中,假設(shè)本地主機(jī)linux(10.1.1.1),遠(yuǎn)程主機(jī)linux(10.1.1.2)

把你的本地主機(jī)用戶的ssh公匙文件復(fù)制到遠(yuǎn)程主機(jī)用戶的~/.ssh/authorized_keys文件中,假設(shè)本地主機(jī)linux(10.1.1.1),遠(yuǎn)程主機(jī)linux(10.1.1.2)

一,在linux100主機(jī)里的用戶

運(yùn)行

#ssh-keygen -t rsa

結(jié)果如下

Generating public/private rsa key pair.

Enter file in which to save the key (/home/.username/ssh/id_rsa):#回車(chē)

Enter passphrase (empty for no passphrase):#回車(chē)

Enter same passphrase again:#回車(chē)

Your identification has been saved in /home/.username /.ssh/id_rsa.

Your public key has been saved in /home/.username /.ssh/id_rsa.pub.

The key fingerprint is:

38:25:c1:4d:5d:d3:89:bb:46:67:bf:52:af:c3:17:0c username@localhost

Generating RSA keys:

Key generation complete.

會(huì)在用戶目錄~/.ssh/產(chǎn)生兩個(gè)文件,id_rsa,id_rsa.pub

二,把linux(10.1.1.1)主機(jī)上的id_rsa.pub文件拷貝到linux(10.1.1.2)主機(jī)的root用戶主目錄下的.ssh目錄下,并且改名為authorized_keys

即:

/root/.ssh/authorized_keys

這樣在linux100主機(jī)上使用scp命令復(fù)制文件到linux(10.1.1.2)上將不提示輸入密碼了,直接復(fù)制了。反之亦然!

三,復(fù)制文件或目錄命令:

復(fù)制文件:

(1)將本地文件拷貝到遠(yuǎn)程

scp 文件名 --user@10.1.1.2:遠(yuǎn)程路徑

(2)從遠(yuǎn)程將文件拷回本地

scp --user@10.1.1.2:文件名 本地路徑

復(fù)制目錄:

(1)將本地目錄拷貝到遠(yuǎn)程

scp -r 目錄名 --user@10.1.1.2:遠(yuǎn)程路徑

(2)從遠(yuǎn)程將目錄拷回本地

scp -r --user@10.1.1.2:目錄名 本地路徑。

【編輯推薦】

  1. Linux經(jīng)典實(shí)用的使用技巧
  2. 關(guān)于Linux下root用戶密碼遺忘的解決辦法
  3. Linux操作系統(tǒng)上去掉文件屬性的命令介紹
責(zé)任編輯:趙寧寧 來(lái)源: chinaitlab
相關(guān)推薦

2010-04-27 15:08:01

2021-07-04 19:48:07

LinuxFreeDOS復(fù)制文件

2022-05-31 10:38:50

Linux密碼scp

2009-11-18 09:28:44

linuxscp命令

2012-03-12 09:26:47

2009-03-19 19:07:12

2009-12-03 18:15:04

Linux

2009-12-14 11:08:07

Linux scp

2018-01-30 17:00:10

Linuxscp命令排除文件

2015-10-21 11:03:21

ssh登錄Linux

2009-11-23 11:51:07

linuxscp

2020-04-26 14:25:56

目錄Linux操作系統(tǒng)

2013-04-09 15:06:23

2019-12-13 10:42:03

LinuxSCP命令

2021-01-19 11:53:40

Windows 10Windows微軟

2010-03-08 10:49:29

Linux scp命令

2010-06-04 16:03:37

MySQL root密

2018-06-25 13:10:16

Linux復(fù)制重命名

2022-02-25 07:38:35

Linux

2017-02-06 18:00:26

Linuxsudo命令
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)