SFTP root symlink problem

I have set up virtual hosts in apache2 with the site root located at /srv/www/domain.com/publichtml as described in ~~[http://library.linode.com/lamp-guides/ubuntu-10.04-lucid/" target="blank">](http://library.linode.com/lamp-guides/u … .04-lucid/">http://library.linode.com/lamp-guides/ubuntu-10.04-lucid/](

I have set up a new user with a home directory of /home/username

I have then setup an sftp jail as described here ~~[http://library.linode.com/networking/security-guides/linux-sftp-jail" target="_blank">](http://library.linode.com/networking/se … -sftp-jail">http://library.linode.com/networking/security-guides/linux-sftp-jail](

I then created a symlink via

cd /home/username
ln -s /srv/www/domain.com/public_html

When ssh'd in to the server I can

cd /home/username/public_html

and I can see the files.

If I then try to sftp in to the user I can see an alias to publichtml but when I double click on the alias I get the following error "Could not resolve symlink “publichtml”."

Any ideas?

8 Replies

Should be….

ln -s /srv/www/domain.com/public_html /public_html

Hi,

Thanks for taking the time to reply. I removed the symlink I created and followed your instructions and I get the same result as described before

Cheers

Did you set the permissions (change ownership) for that user for that /public_html directory?

Do you mean:-

chown user:user /home/user/public_html

or

chown user:user /srv/www/domain.com/public_html

I tried both and neither worked. Any other ideas

The first - the second Fubar's your web service.

I have been told because it is a jailed sftp i won't be able to symlink out of the jail. I have moved the public_html in to the home folder

@harveyd:

I have been told because it is a jailed sftp i won't be able to symlink out of the jail. I have moved the public_html in to the home folder

Sounds about right, if you're serving clients and letting them sftp into your server it's easier to lock them down to their home directory so stick all their web stuff in there.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct