Hi, I've recently been trying to script up downloading some files from an sftp server, but am seeing some very strange differences between using lftp and using sftp. I wonder if someone can see what i'm doing wrongly with lftp. Example below:
[r...@abcd ~]# sftp -o "IdentityFile=/home/send/sshprivatekey" [email protected] Connecting to x.x.x.x... sftp> ls HomeDirA HomeDirB sftp> cd / sftp> ls RootDirA RootDirB The above works as expected, in my home directory I see some directories. If I cd /, then ls again, I see some directories in the root directory. However, when I do this with lftp I get this: [r...@abcd ~]# lftp lftp :~> set net:max-retries 1 lftp :~> set sftp:connect-program ssh -i /home/send/sshprivatekey lftp :~> open -u username, sftp://x.x.x.x lftp [email protected]:~> ls drwxrwxrwx 0 2002-06-24 08:50 . drwxrwxrwx 0 2002-06-24 08:50 .. drwxrwxrwx 0 2009-11-10 03:21 HomeDirA drwxrwxrwx 0 2008-09-09 13:32 HomeDirB lftp [email protected]:~> cd / cd ok, cwd=/ lftp [email protected]:/> ls drwxrwxrwx 0 2002-06-24 08:50 . drwxrwxrwx 0 2002-06-24 08:50 .. drwxrwxrwx 0 2009-11-10 03:21 HomeDirA drwxrwxrwx 0 2008-09-09 13:32 HomeDirB As far as I can tell, the cd / worked ok, but when I ls, I get a list of the contents of my home directory again?! I can't see anything obvious that i'm doing wrong. Unfortunately I have no idea what ssh/sftp server runs at the other end and I don't think it would be easy to find out (unless there's some magic I can perform with sftp?). If it's helpful, this is lftp 3.7.11, on RHEL 5.4. Thanks Gary
