With proftpd you can change the default directory editing /etc/proftpd.conf
DefaultRoot ~
change to
DefaultRoot ~/music

How i can achieve the same result with SFTP?

Im using ubuntu lucid btw.

Ty so much for your help.

link|improve this question
Which software are you using? – Khaled Nov 1 '10 at 17:28
feedback

4 Answers

up vote 2 down vote accepted

Have a look at this article which shows how to use sshd's ChrootDirectory to force all members of a particular group into a common directory root. You may be able to modify it to meet your requirements.

link|improve this answer
Ty for your answer and the article d(^.^)b – Jonathan B Nov 1 '10 at 20:06
you can also use Match User – Merlin May 2 at 21:38
feedback

Perhaps there is a way to achieve what you want but as far as I know, sftp is operated over ssh so not so sure how to do that with ssh for every user.

However, one way to get around what you want to do is that you can update the user data to log in to certain directory as follows. This will w

$ sudo usermod -d [certain path that you want to direct] username
link|improve this answer
ok thx ill try it d(^.^)z – Jonathan B Nov 1 '10 at 20:01
feedback

I just went through the same sort of thing with an Ubuntu Lucid 10.04 install. The answer seems to be to chroot certain logins to a specific folder. The only disadvantage being that the folder that they are chrooted to must be owned by root:root and can't be writable by the user logging in in order for ssh to allow the sftp login to work. SO, they only have access to other folders within the folder that they are chrooted to.

http://ubuntuforums.org/showthread.php?t=1057657

Also, setting the default folder for the user using "usermod -d doesn't change the default for that user going to the root / folder upon sftp login.

link|improve this answer
Ty ill give it a try – Jonathan B Nov 11 '10 at 5:53
feedback

If you're using ProFTPD, then take a look at the ProFTPD SFTP module.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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