脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|shell|

服务器之家 - 脚本之家 - shell - bash scp command not found的解决方法

bash scp command not found的解决方法

2022-12-19 15:52脚本之家 shell

今天在一系统上运行bash scp提示command not found,经过如下方法解决了,需要的朋友可以参考下

安装了centos6.0,由于选择了最小安装,很多包没有安装,因此一些常用的命令也不支持,如下:
# scp
-bash: scp: command not found

我的解决方法是:在一台运行正常的CentOS 5.6服务器上找到scp所在的包:
##---以下命令在运行正常的CentOS 5.6上执行

 

复制代码 代码如下:

# which scp
/usr/bin/scp

# rpm -qf /usr/bin/scp
openssh-clients-4.3p2-72.el5

 

这么看来scp所在的包是openssh-clients了。

在不正常的机器上安装吧:

 

复制代码 代码如下:

# yum install openssh-clients
或者从光盘上安装
# rpm -ivh libedit-2.11-4.20080712cvs.1.el6.x86_64
# rpm -ivh openssh-clients-5.3p1-20.el6.x86_64

 

至此,scp命令可以执行了。

注意:以上用到的包名请大家根据自己的情况进行调整。

延伸 · 阅读

精彩推荐