Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to configure a linux box (probably an Ubuntu server) so that I can setup users, so that it is possible to upload/download files via rsync/scp/sftp, but it should not be possible to ssh to the machine and get an interactive terminal.

Is this possible? How would I go about configuring that? I know that all I'll need the ssh server to be ON, for rsync/scp/sftp to work, but I guess there should be a way to prevent the direct login.

share|improve this question
I don't think that's possible coz you need a username and pass to use rsync, whoever has the username and pass can login, even if you create an ssh key just for rsync, won't work, would love to be proven wrong though – Lynob Sep 5 '13 at 9:29
It's possible to allow only SFTP with Match User ... / ForceCommand Internal-sftp in sshd_config. But to allow several programs i can't help. – mveroone Sep 5 '13 at 9:36
You need a chroot jail, SourceForge implements a very good one but I can't find documentation on it. – justbrowsing Sep 5 '13 at 9:54
up vote 5 down vote accepted

Set the users' shell to rssh. From the manpage:

rssh - restricted secure shell allowing only scp and/or sftp

share|improve this answer
That is brilliant... Thanks :) – Eldamir Sep 5 '13 at 18:30

You can use a pseudo-shell like scponly and set this for the users you don't want to login directly.

Another possible way is to set the login command in the authorized keys file, but that only works if your users login via SSH-keys and not via password.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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