# [SOLVED] open ssh & internal-sftp

## sinfoni

Hi,

I try to get this working:

https://forums.gentoo.org/viewtopic-t-698685-start-0.html

but I can't...

/etc/ssh/ssh_config

```

SendEnv LANG LC_*

SyslogFacility LOCAL6

Match Group sftponly

        ChrootDirectory /home/%u/%u

    X11Forwarding no 

    AllowTcpForwarding no

        ForceCommand internal-sftp        

```

/etc/shells

```

# /etc/shells: valid login shells

/bin/bash

/bin/csh

/bin/esh

/bin/fish

/bin/ksh

/bin/sash

/bin/sh

/bin/tcsh

/bin/zsh

/bin/false

```

I created sftponly group:

```

sftponly:x:1001:

```

I created test4 and  test5 users :

```

test4:x:1004:1001::/home/test4:/bin/bash

test5:x:1005:1001::/home/test5:/bin/false

```

test4 and test5 home directories:

```

GENTOO home # ls -l

drwxr-xr-x 3 root   root   4096 10 sept. 15:08 test4

drwxr-xr-x 3 root   root   4096 10 sept. 15:22 test5

```

/home/test4:

```

GENTOO test4 # ls -l

total 4

drwxr-xr-x 2 test4 sftponly 4096 10 sept. 15:08 test4

```

/home/test5:

```

GENTOO test5 # ls -l

total 4

drwxr-xr-x 2 test5 sftponly 4096 10 sept. 15:22 test5

```

When I use test4, (/bin/bash): Connexion ok but I can see all the disk... That's not the goal... 

When I use test5, (/bin/false): I can't connect.

SFTP client error :

```

Commande :   open "test5@192.9.200.98" 22

Commande :   Pass: **********

Statut :   Connected to 192.9.200.98

Erreur :   Connection closed by server with exitcode 1

Erreur :   Impossible d'établir une connexion au serveur

```

sshd log:

```

Sep 10 16:25:59 gentoo sshd[5723]: SSH: Server;Ltype: Version;Remote: 192.9.200.209-56809;Protocol: 2.0;Client: PuTTY_Local:_Aug__6_2013_19:42:56

Sep 10 16:25:59 gentoo sshd[5723]: SSH: Server;Ltype: Kex;Remote: 192.9.200.209-56809;Enc: aes256-ctr;MAC: hmac-sha1;Comp: none [preauth]

Sep 10 16:25:59 gentoo sshd[5723]: SSH: Server;Ltype: Authname;Remote: 192.9.200.209-56809;Name: test5 [preauth]

Sep 10 16:26:00 gentoo sshd[5723]: Accepted keyboard-interactive/pam for test5 from 192.9.200.209 port 56809 ssh2

Sep 10 16:26:00 gentoo sshd[5723]: pam_unix(sshd:session): session opened for user test5 by (uid=0)

Sep 10 16:26:00 gentoo sshd[5727]: SSH: Server;Ltype: Kex;Remote: 192.9.200.209-56809;Enc: aes256-ctr;MAC: hmac-sha1;Comp: none

Sep 10 16:26:00 gentoo sshd[5727]: SSH: Server;LType: Throughput;Remote: 192.9.200.209-56809;IN: 1816;OUT: 1000;Duration: 0.6;tPut_in: 2944.6;tPut_out: 1621.5

Sep 10 16:26:00 gentoo sshd[5723]: pam_unix(sshd:session): session closed for user test5

```

I have no clue at all .... What is wrong is this config ?

Thanks in advance for any help.

AndréLast edited by sinfoni on Wed Sep 10, 2014 4:43 pm; edited 1 time in total

----------

## sinfoni

Damned ! I worked with /etc/ssh/ssh_config  instead of /etc/sshd/ssh_config !

Now it works....

----------

