Linux bash: scp: command not found的问题记录
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Linux bash: scp: command not found的问题记录,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4646字,纯文字阅读大概需要7分钟。
内容图文
1,scp报错
[root@localhost soft]# scpjdk-7u55-linux-x64.tar.gz 192.168.121.246:/soft/
root@192.168.121.246's password:
bash: scp: command not found
lost connection
[root@localhost soft]#
2,调试-v
[root@localhost 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
root@192.168.121.246's 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可以看出问题应该出在接收端服务器上的scp问题。
3,去接收端121.246上面查看scp
[root@localhost ~]# type scp
-bash: type: scp: not found
[root@localhost ~]#
果然不识别scp,试试yum安装,如下所示,无效:
[root@localhost ~]# 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
[root@localhost ~]#
baidu到,yum安装scp包,是openssh-clients,所以重新yum安装
执行yum install openssh-clients* -y安装
ok,在check,scp已经能用了,如下所示
[root@localhost ~]# type scp
scp is /usr/bin/scp
[root@localhost ~]#
4,现在原来的服务器上scp就能成功了
[root@localhost soft]# scpjdk-7u55-linux-x64.tar.gz 192.168.121.246:/soft/
root@192.168.121.246's password:
jdk-7u55-linux-x64.tar.gz 100% 132MB 131.8MB/s 00:01
[root@localhost soft]#
5,总结
scp成功,需要两个服务器都安装了scp服务才行。
内容总结
以上是互联网集市为您收集整理的Linux bash: scp: command not found的问题记录全部内容,希望文章能够帮你解决Linux bash: scp: command not found的问题记录所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。