LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-09-2011, 02:13 PM   #1
sampappachan_nyc
Member
 
Registered: Jan 2009
Location: New York
Distribution: Red Hat, CentOS,Fedora, Ubuntu, SUSE, linux mint
Posts: 53

Rep: Reputation: 0
Lightbulb Jailing a SFTP user.


Hi,

In RedHat 4/5 How can i jail/restrict an sftp user to his home directory ?

Can i do this without using rssh ?

Please advise.

Thank You
Sam
 
Old 03-09-2011, 02:27 PM   #2
corp769
Guru
 
Registered: Apr 2005
Posts: 5,807

Rep: Reputation: 995Reputation: 995Reputation: 995Reputation: 995Reputation: 995Reputation: 995Reputation: 995Reputation: 995
You would need to change the settings to jail to the home directory as such:
Code:
Match user userxx
        ChrootDirectory /home/userxx/files
        ForceCommand internal-sftp
        AllowTcpForwarding no
        GatewayPorts no
        X11Forwarding no
You would need to add that to /etc/sshd_config. Of course you can change the directory being jailed to.

Josh
 
Old 03-11-2011, 03:50 PM   #3
sampappachan_nyc
Member
 
Registered: Jan 2009
Location: New York
Distribution: Red Hat, CentOS,Fedora, Ubuntu, SUSE, linux mint
Posts: 53

Original Poster
Rep: Reputation: 0
Hi Josh,

I have tried this before, and go this message:
#service sshd restart

Stopping sshd: [FAILED]
Starting sshd: /etc/ssh/sshd_config: line 122: Bad configuration option: Match
/etc/ssh/sshd_config: line 126: Bad configuration option: ForceCommand
/etc/ssh/sshd_config: terminating, 2 bad configuration options
[FAILED]

**Rh5's latest open-ssh package does not support Match User directive.


Thanks for the reply.
 
Old 03-11-2011, 05:25 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by sampappachan_nyc
In RedHat 4/5 How can i jail/restrict an sftp user to his home directory ?
Written just for you:
http://www.linuxquestions.org/questi...on-rhel5-3495/
 
1 members found this post helpful.
Old 03-16-2011, 08:53 AM   #5
sampappachan_nyc
Member
 
Registered: Jan 2009
Location: New York
Distribution: Red Hat, CentOS,Fedora, Ubuntu, SUSE, linux mint
Posts: 53

Original Poster
Rep: Reputation: 0
Thank You For the help Anomie, it worked...


You are awesome !



Thanks
Sam Pappachan
 
  


Reply

Tags
sftp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
chroot sftp jailing on OEL5u3 - what should be its SSH version? abrarpasha.syed Linux - General 4 01-08-2011 03:06 PM
how to create sftp user only in red hat 4 not ftp user ..only sftp user princeu28 Linux - Newbie 1 10-14-2008 08:10 AM
Jailing an user SiLiCoN Linux - General 4 10-09-2004 04:49 AM
user jailing ? SiLiCoN Linux - Security 3 10-09-2004 02:20 AM
Jailing SFTP Users to Home directory Jason_25 Linux - Networking 3 01-06-2002 08:32 PM


All times are GMT -5. The time now is 05:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration