Our hosting provider does not allow ssh-access (because security), but lets us upload files and manipulate directories via sftp. (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 entire sftp-client or its ls-command, that would list symlinks properly -- the way the real ls(1) would?

migrated from serverfault.com May 22 '17 at 23:18

This question came from our site for system and network administrators.


The OpenSSH SFTP client does not currently support this.

#ifdef notyet
char *
do_readlink(struct sftp_conn *conn, const char *path)

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.

  • FileZilla cannot display link target either. +1 anyway – Martin Prikryl May 23 '17 at 5:47
  • 1
    Some versions of curl can do sftp too. If you use the url of the directory it will show the typical ls -l output with -> for symbolic links. – meuh May 23 '17 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.