Linux bash: scp: command not found的问题记录

1,scp报错

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

[email protected]‘s 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]‘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

[[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,现在原来的服务器上scp就能成功了

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

[email protected]‘s password:

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

[[email protected] soft]#

5,总结

scp成功,需要两个服务器都安装了scp服务才行。

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-10-19 15:01:41

Linux bash: scp: command not found的问题记录的相关文章

Linux下bash: scp: command not found问题 或者装ssh包时报错 Requires: libedit.so.0()(64bit)

    一.用scp命令从物理主机向CentOS 6.1虚拟机传送文件,提示以下错误:bash: scp: command not found到CentOS 6.1虚拟机查看也缺少scp命令.该虚拟机是同事安装的,还有其他命令也不完整,可能不是完整安装,缺了些包. 二.用以下方法解决: 1.在一台完整的CentOS 5.8查找scp所在的包:# which scp/usr/bin/scp# rpm -qf /usr/bin/scpopenssh-clients-4.3p2-82.el5 2.查出

解决 linux -bash: telnet: command not found

输入命令telnet提示  linux -bash: telnet: command not found 解决方法: yum list telnet*   查看telnet相关的安装包 yum install telnet-server 安装telnet服务 yum install telnet.* 安装telnet客户端 然后运行telnet正常了

bash: scp: command not found

现在需要远程复制源码包使用scp命令:[[email protected] Downloads]# scp nginx-1.6.2.tar.gz 172.25.16.2:[email protected]'s password:      bash: scp: command not found       //提示错误lost connection//解决方法:[[email protected] Downloads]# which scp/bin/scp[[email protected]

Linux Bash Scripting - Command Chaining & Command lists

# this is to show you how to execute a series of commands in one strike. $ clear; cd /; ls -l; echo "You are in $PWD"; echo "Time to go back home"; cd ~; # use semi colon between each command. # There is also command lists, which is fo

bash: scp: command not found lost connection问题解决

在内网,从一台服务器传mysql的源码安装包到另外一台服务器时,发生如下的错误: [root @localhost ~]# scp mysql-5.1.55.tar.gz [email protected]:. [email protected]'s password: bash: scp: command not found lost connection 提示scp的命令找不到,但是查找发现命令是存在的 [root @localhost ~]# whereis scp scp: /usr/b

解决scp时报bash: scp: command not found的错误

在进行scp时报bash: scp: command not found [[email protected] add_admin]# scp ocp_admin_privileges.mysql [email protected]:/root[email protected]'s password: bash: scp: command not foundlost connection 查看本机是否安装openssh-clients软件包 [[email protected] add_admi

linux -bash: ipconfig: command not found 解决方法

问题: ipconfig: command not found [[email protected] root]# ipconfig -bash: ipconfig: command not found 方法: 1.安装好CentOS5.5后,ipconfig找不到那说明没有将ipconfig命令配置到环境变量. 2.测试下结果echo $PATH,果然/sbin这个主要目录不在PATH. [[email protected] network-scripts]# echo $PATH /usr/

linux bash XXX command not found

1.最小化安装了centos, 但是使用ifconfig命令时候出现"bash ifconfig command not found" .解决方法:yum install net-tools.x86_64" . 原文地址:https://www.cnblogs.com/EikiXu/p/9411338.html

LINUX -bash java command not found

Linux系统是由于设置JAVA环境变量时设置PATH属性导致command not found错误,PATH属性设置如下: vi /etc/profile JAVA_HOME=/usr/java/jdk1.6.0_32 根据自己的安装路径修改PATH=$PATH:$JAVA_HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.ja