Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 –  Fischer 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. –  Kwaio 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
add comment

2 Answers

up vote 2 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
add comment

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
add comment

Your Answer

 
discard

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.