Tag Archives: scp

SCP Error: Host key verification failed [How to Solve]

1 scp Error: REMOTE HOST IDENTIFICATION HAS CHANGED!

[root@xx ~]# scp yum-3.4.3.tar.gz 10.xx.xx.12:/root
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
xxxxx.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:20
RSA host key for 10.xx.xx.12 has changed and you have requested strict checking.
Host key verification failed.
lost connection
[root@cache-2 ~]#

2, google, RSA error, either rebuild the RSA Key, or delete the Client’s known_hosts in the corresponding ip information records, here choose the latter.

 

 

3, first find the path of known_hosts
[root@xx tmp]# find/-name known_hosts
/root/.ssh/known_hosts

4, first backup the system files, before modifying
[root@cache-2 tmp]#
[root@cache-2 tmp]#
[root@cache-2 tmp]# cp /root/.ssh/known_hosts /root/.ssh/bak.20140526.known_hosts
[root@cache-2 tmp]#
[root@cache-2 tmp]# vim /root/.ssh/known_hosts
Find
10.xx.xx.12 ssh-rsaAAAAB3NzaC1yc2EAAAABIwAAAQEA0ifRyEQAdoH+1GFnFv+c+vzQ8tCIxREuAff57heXPt0sJpTNaJaB/RsFV4yKmBdyrOggdmxEdm1G851Ni+m

6OW7fzUdZnqfQaF/pAmu0fyhVGWa0rjNG6IVyrrFEMKxn8cgLSLfxSwfC8aM6y30sCBAeUy6xTUI2ImOMk9e9UR6vBSENweZUj53CqfIg/NfqL1GozSh

iKF4+Wt3zuQDVTMNbPeB3Yyp3U+v4TLnAaYgA5fjGGZmN0QUcI//toZpyVVWmFnxXUKhqFzmHDPNrlfgq2nCqXCdYUVCZHty7hupDY0YkzUt12VR5

Ifdg2BpvHZki5cPZL/046laeIX1DGw==
Delete!

5, then execute the scp command, enter the password, and the transfer is successful.
[root@xx ~]# scp yum-3.4.3.tar.gz 10.xx.xx.12:/root
[email protected]’s password:
yum-3.4.3.tar.gz                                                                                                                                             100% 1114KB   1.1MB/s   00:00
[root@xx ~]#

 

[Solved] SCP transmission prompt bash: SCP: command not found

One end is missing the scp-related packet source
[oracle@rac1 dump_dir]$ scp /mnt/dump_dir/expdp_orders_2tabs2* 192.168.X.247:/home/oracle/dump_dir
[email protected]’s password:
bash: scp: command not found
Objectives
[root@localhost ~]# -bash: scp: command not found
-bash: -bash:: command not found

[root@localhost ~]# yum install openssh-clients
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.cn99.com
* updates: mirrors.aliyun.com
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package openssh-clients.x86_64 0:5.3p1-123.el6_9 will be installed
–> Processing Dependency: openssh = 5.3p1-123.el6_9 for package: openssh-clients-5.3p1-123.el6_9.x86_64
–> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: openssh-clients-5.3p1-123.el6_9.x86_64
–> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit) for package: openssh-clients-5.3p1-123.el6_9.x86_64
–> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1)(64bit) for package: openssh-clients-5.3p1-123.el6_9.x86_64
–> Processing Dependency: libedit.so.0()(64bit) for package: openssh-clients-5.3p1-123.el6_9.x86_64
–> Running transaction check
—> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
—> Package openssh.x86_64 0:5.3p1-70.el6 will be updated
–> Processing Dependency: openssh = 5.3p1-70.el6 for package: openssh-server-5.3p1-70.el6.x86_64
—> Package openssh.x86_64 0:5.3p1-123.el6_9 will be an update
—> Package openssl.x86_64 0:1.0.0-20.el6 will be updated
—> Package openssl.x86_64 0:1.0.1e-57.el6 will be an update
–> Running transaction check
—> Package openssh-server.x86_64 0:5.3p1-70.el6 will be updated
—> Package openssh-server.x86_64 0:5.3p1-123.el6_9 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================================================
Installing:
openssh-clients x86_64 5.3p1-123.el6_9 base 444 k
Installing for dependencies:
libedit x86_64 2.11-4.20080712cvs.1.el6 base 74 k
Updating for dependencies:
openssh x86_64 5.3p1-123.el6_9 base 277 k
openssh-server x86_64 5.3p1-123.el6_9 base 329 k
openssl x86_64 1.0.1e-57.el6 base 1.5 M

Transaction Summary
================================================================================================================================================================================================================
Install 2 Package(s)
Upgrade 3 Package(s)

Total download size: 2.6 M
Is this ok [y/N]: Y
Downloading Packages:
(1/5): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm | 74 kB 00:00
(2/5): openssh-5.3p1-123.el6_9.x86_64.rpm | 277 kB 00:00
(3/5): openssh-clients-5.3p1-123.el6_9.x86_64.rpm | 444 kB 00:00
(4/5): openssh-server-5.3p1-123.el6_9.x86_64.rpm | 329 kB 00:00
(5/5): openssl-1.0.1e-57.el6.x86_64.rpm | 1.5 MB 00:00
—————————————————————————————————————————————————————————————————————-
Total 363 kB/s | 2.6 MB 00:07
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : openssl-1.0.1e-57.el6.x86_64 1/8
Updating : openssh-5.3p1-123.el6_9.x86_64 2/8
Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64 3/8
Installing : openssh-clients-5.3p1-123.el6_9.x86_64 4/8
Updating : openssh-server-5.3p1-123.el6_9.x86_64 5/8
Cleanup : openssh-server-5.3p1-70.el6.x86_64 6/8
Cleanup : openssh-5.3p1-70.el6.x86_64 7/8
Cleanup : openssl-1.0.0-20.el6.x86_64 8/8

Installed:
openssh-clients.x86_64 0:5.3p1-123.el6_9

Dependency Installed:
libedit.x86_64 0:2.11-4.20080712cvs.1.el6

Dependency Updated:
openssh.x86_64 0:5.3p1-123.el6_9 openssh-server.x86_64 0:5.3p1-123.el6_9 openssl.x86_64 0:1.0.1e-57.el6

Complete!

Once the installation is complete, it’s OK!

scp:not a regular file

This article gives you a comprehensive understanding of Java object serialization and deserialization>>>

Upload Linux local files to the server

scp /home/XXX/file.1txt [email protected] :/user/XXX

Download files from the server

scp [email protected] :/user/XXX/file1.txt/home/XXX

Command

[email protected] :/user/XXX//home/XXX

CP error: not a regular file

The reason is that this is equivalent to downloading a folder, not a file

The solution is to add the parameter – R

scp [email protected] :/user/XXX//home/XXX

That’s it