使用scp命令“bash:scp:command not found”时出错
发布时间:2020-12-15 16:23:20 所属栏目:安全 来源:网络整理
导读:我想使用scp命令将本地文件复制到远程服务器,但是我在远程服务器中输入用户的密码后收到一条错误消息。 ~]$ scp gitadmin.pub git@123.150.207.18:git@123.150.207.18's password: bash: scp: command not foundlost connection 我在使用git用户的服务器上
我想使用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作为服务器。) 这是我在路径设置的错误。 export PATH="/usr/local/node/bin:$PATH" 但格式是错误的。我删除了一对’“’,它现在工作正常,应该是: export PATH=$PATH:/usr/local/node/bin 探头错误… ^ _ ^
确保scp命令在客户端和服务器上都可用。
如果这是Fedora或Red Hat Enterprise Linux和克隆(CentOS),请确保已安装此软件包: yum -y install openssh-clients 如果您使用Debian或Ubuntu和克隆,请安装此软件包: apt-get install openssh-client 同样,你需要在服务器和客户端上这样做,否则你可能会遇到客户端上的“奇怪”错误消息:scp:command not found或类似,尽管你在本地。这已经困惑成千上万的人,我猜:) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |