我想使用scp命令将本地文件复制到远程服务器,但在输入远程服务器用户密码后,我收到了一个错误消息。
~]$ scp gitadmin.pub git@123.150.207.18:
git@123.150.207.18's password:
bash: scp: command not found
lost connection
我使用git用户检查了服务器,看起来scp命令可以找到并且openssh-clinets也已安装。git@... ~]$ scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2
git@... ~]$ su root
......
root@... ~]# yum info openssh-clients
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Installed Packages
Name : openssh-clients
Arch : x86_64
Version : 5.3p1
Release : 52.el6
Size : 1.0 M
Repo : installed
From repo : anaconda-RedHatEnterpriseLinux-201105101844.x86_64
Summary : An open source SSH client applications
URL : http://www.openssh.com/portable.html
License : BSD
Description : OpenSSH is a free version of SSH (Secure SHell), a program for
: logging into and executing commands on a remote machine. This
: package includes the clients necessary to make encrypted
: connections to SSH servers.
我对这种情况感到困惑。是我错过了服务器上的某些配置吗?(我们使用的是RHEL6作为服务器。)
路径设置是我的问题。 我将“custom.sh”添加到“/etc/profile.d”中,并添加了以下行以将“/usr/local/node/bin”目录添加到PATH中。
export PATH="/usr/local/node/bin:$PATH"
但是格式不对。我移除了一对引号 '"' ,现在它可以正常工作了。正确的格式应该是:
export PATH=$PATH:/usr/local/node/bin
一个探针错误可能会导致整个系统崩溃。^_^