- 论坛徽章:
- 0
|
solaris ssh: scp: not found ?
问题解决,参考了以下文件\r\n\r\nIf none of this works, put the following in .ssh/environment (or \r\n.ssh2/environment) on the remote host:\r\n\r\nPATH=/usr/local/bin:/usr/bin:/bin\r\n\r\nOf course PATH would be what you need to find scp. My guess is that scp is in \r\n/usr/local/bin. This is probably in your login scripts like .profile or \r\n/etc/profile. The problem is, scp uses ssh in non-login mode, thus the shell is \r\nnot a login shell and the path is not set properly. The environment file solves \r\nthis for you by making sure the PATH is set properly in these cases. \r\n\r\nTo test my hypothesis, before creating the PATH entry in the environment file \r\nrun:\r\n\r\n ssh remote_scp_host \'echo $PATH\'\r\n \r\nYou will probably just see a very basic PATH without the dir that scp resides \r\nin. Now create the environment file with a PATH entry and do it again.\r\n\r\nOTOH, if you are running a shell like csh or bash that have individual command \r\nfiles per invocation, e.g. .cshrc or .bashrc, look in there and make sure the \r\nPATH is being set properly and not being reset to something minimal. The above \r\nssh ... above will help you track it down. |
|