LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-11-2011, 12:08 PM   #1
DejaCpp
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Rep: Reputation: 0
Question 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.
 
Old 02-11-2011, 12:21 PM   #2
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
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?
 
Old 02-11-2011, 02:33 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by DejaCpp View Post
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
 
Old 02-14-2011, 10:47 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
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.)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SSH/SCP help Jinouchi Linux - Newbie 9 02-14-2010 10:37 PM
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 02:23 AM
scp and ssh linderox Linux - Networking 2 11-19-2007 02:04 AM
SSH/SCP with no password wh33t Linux - Software 11 06-09-2007 11:38 PM
ssh/scp problems markcole Arch 5 05-03-2006 09:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration