LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Disable SSH but allow SCP (https://www.linuxquestions.org/questions/linux-security-4/disable-ssh-but-allow-scp-862091/)

DejaCpp 02-11-2011 12:08 PM

Disable SSH but allow SCP
 
Is there a way to modify the ssh_config and sshd_config files so that a user can scp but will not be allowed to ssh. I have done a search and found a tool name scponly but I really do not want to install anything. Most of the books I have only discuss how to use ssh. Thanks.

unixfool 02-11-2011 12:21 PM

Have you tried reaching out to the scponly developers? They might have some insight.

Maybe this will help:

Quote:

From http://www.sublimation.org/scponly/w....php/Features:

Instead of just a single anon user, scponly supports configuring potentially many users, each of which could could be set up to provide access to distinct directory trees. Aside from the installation details (see Install), each of these users would have their default shell in /etc/passwd set to "/usr/local/sbin/scponly" (or wherever you choose to install it). This would mean users with this shell can neither login interactively or execute commands remotely. They can however, scp files in and out, governed by the usual unix file permissions.
So, maybe instead of using "/usr/local/sbin/scponly" within the /etc/passwd file, set it to the path of your install of scp?

TB0ne 02-11-2011 02:33 PM

Quote:

Originally Posted by DejaCpp (Post 4255363)
Is there a way to modify the ssh_config and sshd_config files so that a user can scp but will not be allowed to ssh. I have done a search and found a tool name scponly but I really do not want to install anything. Most of the books I have only discuss how to use ssh. Thanks.

Well, you could try to set the users shell to /usr/bin/scp, instead of to /bin/bash, and see if that'll work. Other than that, this page may help you:

http://www.snailbook.com/faq/restricted-scp.auto.html

anomie 02-14-2011 10:47 PM

Quote:

Originally Posted by DejaCpp
Is there a way to modify the ssh_config and sshd_config files so that a user can scp but will not be allowed to ssh.

Which OS / version? More importantly, which OpenSSH version?

If your OpenSSH supports the Match / ForceCommand directives, then you're all set, a la:

http://www.debian-administration.org/articles/590

(You can do this with or without chrooting the users, BTW.)


All times are GMT -5. The time now is 10:32 AM.