1. 程式人生 > >Linux bash: scp: command not found的問題記錄

Linux bash: scp: command not found的問題記錄

private ssl load round ase chan ram option cat

1,scp報錯

[[email protected] soft]# scpjdk-7u55-linux-x64.tar.gz 192.168.121.246:/soft/

[email protected] password:

bash: scp: command not found

lost connection

[[email protected] soft]#

2,調試-v

[[email protected] soft]# scp -vjdk-7u55-linux-x64.tar.gz 192.168.121.246:/soft/

Executing: program /usr/bin/ssh host192.168.121.246, user (unspecified), command scp -v -t /soft/

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb2013

debug1: Reading configuration data/etc/ssh/ssh_config

debug1: Applying options for *

debug1: Connecting to 192.168.121.246[192.168.121.246] port 22.

debug1: Connection established.

debug1: permanently_set_uid: 0/0

debug1: identity file /root/.ssh/identitytype -1

debug1: identity file/root/.ssh/identity-cert type -1

debug1: identity file /root/.ssh/id_rsatype -1

debug1: identity file/root/.ssh/id_rsa-cert type -1

debug1: identity file /root/.ssh/id_dsatype -1

debug1: identity file/root/.ssh/id_dsa-cert type -1

debug1: identity file /root/.ssh/id_ecdsatype -1

debug1: identity file/root/.ssh/id_ecdsa-cert type -1

debug1: Remote protocol version 2.0, remotesoftware version OpenSSH_5.3

debug1: match: OpenSSH_5.3 pat OpenSSH*

debug1: Enabling compatibility mode forprotocol 2.0

debug1: Local version stringSSH-2.0-OpenSSH_5.3

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: server->client aes128-ctrhmac-md5 none

debug1: kex: client->server aes128-ctrhmac-md5 none

debug1:SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug1: Host ‘192.168.121.246‘ is known andmatches the RSA host key.

debug1: Found key in/root/.ssh/known_hosts:1

debug1: ssh_rsa_verify: signature correct

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: SSH2_MSG_SERVICE_REQUEST sent

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue:publickey,gssapi-keyex,gssapi-with-mic,password

debug1: Next authentication method:gssapi-keyex

debug1: No valid Key exchange context

debug1: Next authentication method:gssapi-with-mic

debug1: Unspecified GSS failure. Minor code may provide more information

Cannot determine realm for numeric hostaddress

debug1: Unspecified GSS failure. Minor code may provide more information

Cannot determine realm for numeric hostaddress

debug1: Unspecified GSS failure. Minor code may provide more information

debug1: Unspecified GSS failure. Minor code may provide more information

Cannot determine realm for numeric hostaddress

debug1: Next authentication method:publickey

debug1: Trying private key:/root/.ssh/identity

debug1: Trying private key:/root/.ssh/id_rsa

debug1: Trying private key:/root/.ssh/id_dsa

debug1: Trying private key:/root/.ssh/id_ecdsa

debug1: Next authentication method:password

[email protected] password:

看到例如以下信息:

......

debug1: Host ‘192.168.121.246‘ is known andmatches the RSA host key.

debug1: Found key in/root/.ssh/known_hosts:1

debug1: ssh_rsa_verify: signature correct

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: SSH2_MSG_SERVICE_REQUEST sent

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue:publickey,gssapi-keyex,gssapi-with-mic,password

debug1: Next authentication method:gssapi-keyex

debug1: No valid Key exchange context

debug1: Next authentication method:gssapi-with-mic

......

debug1: No valid Key exchangecontext能夠看出問題應該出在接收端server上的scp問題。

3,去接收端121.246上面查看scp

[[email protected] ~]# type scp

-bash: type: scp: not found

[[email protected] ~]#

果然不識別scp,試試yum安裝,例如以下所看到的,無效:

[[email protected] ~]# yum install -y scp

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

*base: ftp.sjtu.edu.cn

*extras: mirrors.163.com

*updates: centos.ustc.edu.cn

Setting up Install Process

No package scp available.

Error: Nothing to do

[[email protected] ~]#

baidu到,yum安裝scp包,是openssh-clients,所以又一次yum安裝

運行yum install openssh-clients* -y安裝

ok。在check,scp已經能用了。例如以下所看到的

[[email protected] ~]# type scp

scp is /usr/bin/scp

[[email protected] ~]#

4,如今原來的server上scp就能成功了

[[email protected] soft]# scpjdk-7u55-linux-x64.tar.gz 192.168.121.246:/soft/

[email protected] password:

jdk-7u55-linux-x64.tar.gz 100% 132MB 131.8MB/s 00:01

[[email protected] soft]#

5,總結

scp成功,須要兩個server都安裝了scp服務才行。

Linux bash: scp: command not found的問題記錄