# Chrooted SFTP in Jail



## RedErick (Oct 12, 2013)

Hello! 
I'm tying to up chrooted SFTP-server in jail. My FreeBSD version:

```
uname -a
FreeBSD jail1.jail 9.1-RELEASE FreeBSD 9.1-RELEASE #3: Wed Oct  9 21:21:57 EEST 2013     root@server.home:/usr/src/sys/amd64/compile/SERVER  amd64
```
SSH-version:

```
ssh -v
OpenSSH_5.8p2 FreeBSD-20110503, OpenSSL 0.9.8x 10 May 2012
...
```
I'm trying to use next ssh_config:

```
Protocol 2
Subsystem sftp internal-sftp
Match User fileuser
ChrootDirectory %h
ForceCommand internal-sftp
```
But, during connection I have:

```
sftp fileuser@192.168.1.200
/etc/ssh/ssh_config: line 51: Bad configuration option: Subsystem
/etc/ssh/ssh_config: line 52: Bad configuration option: Match
/etc/ssh/ssh_config: line 53: Bad configuration option: ChrootDirectory
/etc/ssh/ssh_config: line 54: Bad configuration option: ForceCommand
/etc/ssh/ssh_config: terminating, 4 bad configuration options
Connection closed
```
Please, help me


----------



## Erratus (Oct 12, 2013)

Should we guess what's in line 51 to 54?


----------



## RedErick (Oct 12, 2013)

My version of SSH is 5.8. So I can't understand in what my problem is. That commands (Match, ChrootDirectory, ForceCommand, etc.) exist begining from version OpenSSH 4.4


----------



## junovitch@ (Oct 12, 2013)

There's a difference between /etc/ssh/sshd_config and /etc/ssh/ssh_config.  Once is for server side and one is for client side connections.  It looks like you put your changes in the wrong file.


----------



## RedErick (Oct 12, 2013)

Thank You! 
My problem is solved!


----------

