LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 01-10-2005, 08:16 AM   #1
vanibhat
LQ Newbie
 
Registered: Jul 2003
Posts: 13

Rep: Reputation: 0
Allowing only SFTP access


Hello

I want to restrict few users only to have SFTP access ( Linux Advanced Server 2.4). They should not be able to login thro SSH. I am sure there are lot of ways. doing so. I think even from tcp Wrappers I would be able to restict the users only to SFTP.

My concern is the security issue.
I am not sure if this is the way to do in the Production environment.

I appreciate if you can provide me some better ways to achieve this.


Thanks in advance
Vani
 
Old 01-10-2005, 08:25 AM   #2
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
hey

two ways:

1. in your /etc/ssh/ssh_config or sshd_config, you can add a line to "DenyUsers" eg:

DenyUsers bob alex

Or, you could SCP (and only let people use WinSCP or a similar programme). You can download and insall the scponly shell (and then change the entry in /etc/passwd . This means that users do not have a shell which they can type in. They can only use SCP.

Maybe, there is a SFTP shell as well.

Hamish
 
Old 01-12-2005, 07:46 AM   #3
wayneg76
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat 7.3, 8.0
Posts: 4

Rep: Reputation: 0
Hi there,

we have it with SCPONLY Shell up and running.

BUT: compile the scponly shell with --enable-chrooted-binary which results in having a second executable, scpolnyc.

Otherwise your users can browse over the complete system (wherever they have access of course). We stumbled upon this when we accessed our SCP Server from a Windows box with WinSCP.

There is a little program called scpjailer which sets up a complete scponly chrooted environment in conjunction with the scponly shell.

Works great and adds an extra level of security.

Greetings

Wayne
 
Old 01-16-2005, 10:26 AM   #4
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
hello

i'm trying to set up chrooting, using scpjailer.

Does the user have to have all of the bin, etc, lib and so on folders in his home folder? I only ask becasue it makes it look cluttered!

Is there a way to put them somewhere else that they can still be accessed?

thanks
hamish

Last edited by hamish; 01-16-2005 at 10:29 AM.
 
Old 01-16-2005, 03:25 PM   #5
wayneg76
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat 7.3, 8.0
Posts: 4

Rep: Reputation: 0
Hi,

yes, he does need to have them. But scpjailer delivers an all in one library, busybox. Itīs in fact one executable which implements all necessary libraries.

It looks cluttered but it is necessary. The scp user needs these to navigate through the file system und execute file operations. As you jailed the user in a directory the user does not have access to the system libraries and executables anymore and needs his own below the jailed directory.

Thatīs why there are the /bin, /etc, /lib etc. directories.

Greetings Wayne
 
Old 01-16-2005, 03:27 PM   #6
hamish
Member
 
Registered: Aug 2003
Location: Edinburgh
Distribution: Server: Gentoo2004; Desktop: Ubuntu
Posts: 720

Rep: Reputation: 30
hey

thanks. it will have to do. works well though

hamish
 
Old 06-12-2005, 11:37 AM   #7
crtn
LQ Newbie
 
Registered: Jun 2005
Posts: 2

Rep: Reputation: 0
Be warned that the last release (0.3) of scpjailer is out of sync with the busybox/openssh/uclib releases! This could easily be a security hole.

The build script _does_not_ work just by changing the versions in the script, but somebody (I'm trying, but I'm not too good at it) should attempt to fix it, since the upstream author (http://tjw.org/scpjailer/) appears to have abandoned maintainence for the time being.
 
Old 06-27-2005, 08:01 AM   #8
javaroast
Member
 
Registered: Apr 2005
Posts: 131

Rep: Reputation: 19
RSSH

I've been using RSSH a restricted shell that allows SFTP and SCP. I chroot each of the users that I set up. Here's the link http://www.pizzashack.org/rssh/index.shtml
 
Old 06-30-2005, 02:10 AM   #9
crtn
LQ Newbie
 
Registered: Jun 2005
Posts: 2

Rep: Reputation: 0
rssh v. scponly

rssh is fine, but see http://www.pizzashack.org/rssh/future.shtml

"As far as I'm concerned, rssh is done. Period. Barring any bugs found, that is... I will fix reported bugs as time allows. Development of this program is, however, anything but a priority for me right now."

scponly is still in active development.
 
  


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
allowing rsh access uerden Linux - Networking 5 11-08-2006 02:15 PM
Allowing sftp without giving a shell koningshoed Linux - Security 8 12-14-2005 08:23 PM
sftp controlled access mb_chris Linux - Security 5 08-25-2005 05:11 PM
LCDproc Allowing Remote Access TemplaraPheonix Linux - Software 0 08-06-2005 10:10 AM
vsftpd not allowing external access bubby Linux - Software 8 12-06-2004 11:48 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 09:49 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