try using scponly
Edit:
Example set-up:
1) create account for using scponly
:
sudo useradd joe
2) change default shell for the account:
sudo chsh joe
answer with /usr/bin/scponly
, (make sure that /usr/bin/scponly
is in /etc/shells
)
3) you can modify joe's home directory to /my/web/site/dir
in /etc/passwd
sudo vim /etc/passwd
4) modify permissions:
sudo chgrp -R joe /my/web/site/dir
sudo chmod -R g+w /my/web/site/dir
5) If you are using AllowUsers
directive in /etc/ssh/sshd_config
add joe to the list
of users that can log in.
6) restart ssh:
sudo /etc/init.d/ssh restart
7) test from another host:
scp web_site_stuff.html [email protected]: