1

I've set up a ftp server for using ftp push on a tv recording page. I've created an extra user for this, who has only access to one directory, which the user is chroot-ed in. But the page does not allow FTP-Pushing to the ftp root directory. But I want the files to go in the FTP user's home/chroot directory. I thought of a symlink. So, /storage/ftppush/ is the real path of the user's chroot home. I tried to create a symlink there to the same directory:

admin@sbusersrv:/storage/ftppush$ ln -s ROOT /storage/ftppush/

But when I try to put some file there using ftp, I get:

ftp> put test /ROOT/test
200 PORT command successful
550 /ROOT/test: Too many levels of symbolic links

How can I make such a working symbolic link for FTP?

  • you say "the page doesn't allow FTP-Pushing to the ftp rood dir"... what page? There is no reason, at least in the ftp spec, that you cannot push directly to the root level of your ftp environment, and I'm not convinced that a symlink will actually circumvent whatever issue you are actually encountering. Try running FTP more verbosely with -v, or look at the FTP logs to see what's really going on. – Klaatu von Schlacker Jan 31 '16 at 18:37
  • I recall having a problem like this before, I believe I solved it either by giving ln a complete/absolute path, or running ln from the directory where I want the symlink to be created. (with either a full path or using ../ to go up a directory) this is just guesswork from my end but well, might as well try. – Cestarian Jan 31 '16 at 20:45
2

You have created an "infinite loop" with a softlink that points to itself. You may have mixed up the arguments to ln. Since the second argument to ln is an existing directory, it will create a softlink with the same "base name" as the first argument, inside that directory. So you create a softlink ROOT which points to ROOT. When trying to resolve this you end up following ROOT to ROOT to ROOT to ROOT until you reach the limit.

If you try ls -L ROOT you will get the same error.

It is not quite clear to me what kind of softlink you actually wanted.

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.