How to list the symbolic links with sftp?
The OpenSSH SFTP client does not currently support this.
#ifdef notyet char * do_readlink(struct sftp_conn *conn, const char *path) { … } #endif
This is the only occurrence of SSH_FXP_READLINK
in the OpenSSH source code. I don't know why this is commented out or what it would take to make it work. The only relevant message I can find on the OpenSSH mailing list is a patch from 2002 that wasn't adopted.
So your only option is to use a different SFTP client, such as SSHFS or curl.
Related videos on Youtube
Comments
-
Mikhail T. almost 2 years
Our hosting provider does not allow
ssh
-access (because security), but lets us upload files and manipulate directories viasftp
. (The only other choice is through "cpanel").sftp
is good enough to allow creating the symbolic links, but not good enough to properly list them. For example:sftp> symlink 500 rwu sftp> ls -l lrwxrwxrwx 1 foo bar 3 May 22 16:27 rwu
That is, I can see the fact that "
rwu
" is a symlink, but I can not see to what. At least, not by default. Is there some "hidden" option to the entiresftp
-client or itsls
-command, that would list symlinks properly -- the way the realls(1)
would? -
Martin Prikryl about 7 yearsFileZilla cannot display link target either. +1 anyway
-
meuh about 7 yearsSome versions of
curl
can do sftp too. If you use the url of the directory it will show the typicalls -l
output with->
for symbolic links.