LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Jailing a SFTP user. (http://www.linuxquestions.org/questions/linux-software-2/jailing-a-sftp-user-867532/)

sampappachan_nyc 03-09-2011 02:13 PM

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

corp769 03-09-2011 02:27 PM

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

sampappachan_nyc 03-11-2011 03:50 PM

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. :)

anomie 03-11-2011 05:25 PM

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/

sampappachan_nyc 03-16-2011 08:53 AM

Thank You For the help Anomie, it worked... :)


You are awesome !



Thanks
Sam Pappachan


All times are GMT -5. The time now is 11:19 PM.