Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] open ssh & internal-sftp
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
sinfoni
n00b
n00b


Joined: 10 Sep 2014
Posts: 6

PostPosted: Wed Sep 10, 2014 2:42 pm    Post subject: [SOLVED] open ssh & internal-sftp Reply with quote

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
Code:

SendEnv LANG LC_*

SyslogFacility LOCAL6
Match Group sftponly
        ChrootDirectory /home/%u/%u
    X11Forwarding no
    AllowTcpForwarding no
        ForceCommand internal-sftp       


/etc/shells
Code:

# /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:
Code:

sftponly:x:1001:

I created test4 and test5 users :
Code:

test4:x:1004:1001::/home/test4:/bin/bash
test5:x:1005:1001::/home/test5:/bin/false


test4 and test5 home directories:
Code:

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:
Code:

GENTOO test4 # ls -l
total 4
drwxr-xr-x 2 test4 sftponly 4096 10 sept. 15:08 test4


/home/test5:
Code:

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 :
Code:

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:
Code:

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
Back to top
View user's profile Send private message
sinfoni
n00b
n00b


Joined: 10 Sep 2014
Posts: 6

PostPosted: Wed Sep 10, 2014 4:42 pm    Post subject: Reply with quote

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

Now it works....
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum