Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: SFTP only

Subject: Re: SFTP only
Date: Mon, 12 Dec 2005 07:35:38 -0800
You can chroot SSH by applying a patch to the OpenSSH source and the 
rebuilding.  You still have to run ldd to identify the needed files and copy 
those to the chrooted environment.  I don't know of any way around this.  

Then what I've done in the past is, once you have the chrooted SSH user, you 
add 'exit' to the top of the user's profile, make that and the parent directory 
owned by another user (root, sysadmin, whatever) - so that the user can't 
overwrite the profile.  When that's in place, the user can sftp into the box 
but cannot get a shell and they are chrooted into the directory you set up. 

It's a pretty quick setup.  Even with having to run the ldd and copy the 
libraries, it's probably less than an hour.

Here's a good link to a doc explaining the process step by step: 
http://www.netadmintools.com/art294.html .

"McDougall, Marshall (FSH)" <MarMcDouga@gov.mb.ca> 12/09/05 6:05 AM >>>
I apologize if this is OT.  

I have a developer who needs access to
/u/l/a/htdocs/his_project_documentation.  I don't want to give him a
shell account because he only needs to dump some online manuals in this
directory. I also don't want him to be able to navigate the file system.

From what I have seen, If I create a user with no shell account, sftp
will not work.  It fails with:

Warning: ssh_packet_wrapper_input: invalid packet received: len
1416128887 closing the offending input channel.

If I create a user with the home drive pointing to
/u/l/a/htdocs/his_project_documentation, all of the dot files get dumped
there and they can still navigate the filesystem.

I have installed rssh from pizzashack.org and have limited them to just
SFTP, but again they can still navigate the filesystem.  If I understand
the CHROOT jail process properly, I would need to copy various system
binaries to the chrooted area and I don't want to do that.

So my burning question is:  How do I give this user sftp access only to
a very limited area of my system?  Any assistance appreciated.

Regards, Marshall


<Prev in Thread] Current Thread [Next in Thread>