AIXSCPNotFound

How to solve an "scp: not found" issue under AIX

Come on, of course SSH and SCP are absolutely essential tools under UNIX! Telnet and FTP are evil protocols that should be chased and removed from your network as soon as possible.

Except, of course, that scp sometimes does not work. Here is an example:

$ scp support-2.3.tar surfer@galactus:
The authenticity of host 'galactus (10.128.100.216)' can't be established.
RSA key fingerprint is 02:36:fb:bd:ef:9b:de:ad:be:ef:ea:db:57:f0:1f:fb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'galactus,10.128.100.216' (RSA) to the list of known hosts.
surfer@galactus's password:
ksh: scp: not found.
lost connection

Oooops. Before re-installing FTP on your AIX machine, you should check the default $PATH of the server... It can explain a lot of things.

In the example shown above, galactus has the scp binary installed, but it is contained in the /usr/local/bin directory... And that directory is not in the default $PATH.

That environment variable is defined in the file named /etc/environment:

# grep -i path /etc/environment
# If /usr/ucb is at the beginning of the PATH the BSD version of commands will
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat

In the example shown above /usr/local/bin has been added to $PATH... And scp now works!

See Also: