FreeBSD - Tutorials, Security
Home   Archives   Sitemap   About   Contact

How to fix "ksh: scp: not found. lost connection" error on AIX

Home NEW! Unix Forum News 100 Tips and Tricks Website Development Server Operating Systems Databases
 Ivorde.ROarrow Server Operating Systems arrowAdministration GuidesarrowHow to fix "ksh: scp: not found. lost connection" error on AIX 

Article Sections

    Hello, Guest !
User name:
Password:
 
Google

 SSD VPS Hosting - Vpsie.com
 Mo.nitor.me
 Ivorde forum
 FreeBSD Tutorials
 Linux LVM Commands
 Free Shell Accounts
 FreeBSD Project
 FreeBSD Handbook
 Advanced Bash-Scripting Guide
 The OpenBSD Project
 Distrowatch
 FreeBSD Handbook


Apache Webserver Home Page

Posted on: 26 Mar 2008
Author: mandrei
Section: Server Operating Systems | Administration Guides
Views: 1270
Comments: 2 (Add)

How to fix "ksh: scp: not found. lost connection" error on AIX
aix, scp, ksh, ksh: scp:  not found. lost connection error

 



Using scp on some flavours of Unix can be tricky some times. For example, on AIX you meight have an error when trying to scp some files from a local directory to a remote directory on a remote server.

$ scp -r * 192.168.2.1:~/
ksh: scp:  not found.
lost connection

Then I noticed a difference:

On the local server:

local$ which scp
/usr/bin/scp


And on the remote server:

remote$ which scp
/usr/local/bin/scp

 when invoked on the remote AIX server , scp loads the environment variable PATH from /etc/environment file. In this case on the remote AIX server there was:

remote$ grep PATH /etc/environment
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat

it's clear that, after connecting to remote AIX server, scp couldn't envoke scp there because it wasn't in the path.

Solution: edit /etc/environment file on the remote server and alter the line where PATH variable is defined as below:

remote$ grep PATH /etc/environment
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/local/bin
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat

Notice that I added the path /usr/local/bin to PATH line in /etc/environment.

This method is applicable on AIX. Depending on your Linux/Unix OS you should edit other files. 

Bookmarks: Echo "How to fix "ksh: scp: not found. lost connection" error on AIX" around:
del.icio.usdiggFurlYahooMyWebGoogleBookmarksFaceBookTechnocratti
-------------------advertising-----------------

Other articles in Server Operating Systems / Administration Guides




Contact webmaster regarding this article
Register or Login to post your article
Hello, Guest ! You can Login or Register to www.ivorde.ro!

 Post comment:

Name:
Title:
Comment:
Please type the word you see in the image (anti-spam verification). Refresh the page if you don't understand the word.
Allowed HTML Tags for comments:<p><strong><em><u><h1><h2><h3><h4><h5><h6><img><li>
<ol><ul><span><div><br><ins><del>

2 comment(s) to How to fix "ksh: scp: not found. lost connection" error on AIX:

1. Re: How to fix "ksh: scp: not found. lost connection" error on AIX
Jr. AIX Admin by Cory at January 12th, 2009 - 14:02
Forgot to mention I was trying to get rsync to work tho

2. Re: How to fix "ksh: scp: not found. lost connection" error on AIX
Jr. AIX Admin by Cory at January 12th, 2009 - 14:01
Thanks

Looked on the net and scratched my head for an hour trying to figure this out.

   Latest topics on the forum:
 
   Most viewed articles:
How to copy a mysql database using mysqldump - 9376 views
How to change a user's password in AIX with the output from ECHO command - 8635 views
FreeBSD: Add/remove an additional IP alias - 5609 views
Qmail relay to smarthost: How to route all mail to a smarthost - 3929 views
Print queues in AIX 5L - How to list print queues in AIX - 2884 views

   Latest 10 articles:
Qmail relay to smarthost: How to route all mail to a smarthost - 03 Feb 2009
EXIM 4 relay to smarthost: How to route all mail except local domain - 03 Feb 2009
Windows XP: print LISTEN ports and network connections using netstat - 30 Jan 2009
How to cut out first last n characters from each file name, from a filelist - 04 Nov 2008
Mozilla Firefox3 is now released - 18 Jun 2008
How to switch lower case to upper case and upper case to lower case in a string - 17 Jun 2008
How to rename files/directories to uppercase/lowercase character names - 17 Jun 2008
How to convert lower case to upper case letters in a shell script/command - 17 Jun 2008
Unix,Linux,FreeBSD - How to rename a list of files, replacing spaces inside their names - 12 Jun 2008
How to change a user's password in AIX with the output from ECHO command - 21 May 2008


Archives
» 2007  |  June  |  October  |  November  |  December
» 2008  |  January  |  February  |  March  |  April  |  May  |  June  |  November
» 2009  |  January  |  February



Home | Archives | Sitemap | About | Contact

Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.  
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.
Valid W3 Document Valid XHTML 1.0 Transitional Valid CSS! The FreeBSD Project Viewable With Any Browser