# How to open sftp-server connection to a Gentoo box?

## MoonWalker

How can I open a secure ftp session to my Gentoo Server? According to man sshd sftp-server should be invoked by adding 'Subsystem sftp-server' to ssh_config. 

What I try to do is open a connection from my Windows machine with FlashFxp 2.0 using SSL/TLS but it don't want to play... any ideas?

----------

## reverius42

 *MoonWalker wrote:*   

> How can I open a secure ftp session to my Gentoo Server? According to man sshd sftp-server should be invoked by adding 'Subsystem sftp-server' to ssh_config. 
> 
> What I try to do is open a connection from my Windows machine with FlashFxp 2.0 using SSL/TLS but it don't want to play... any ideas?

 

Make sure sshd is running (and probably, add it to startup by typing the following):

```
[root@host /root]# rc-update add sshd default
```

----------

## MoonWalker

 *reverius42 wrote:*   

> Make sure sshd is running (and probably, add it to startup by typing the following): 

 

Well thanks for the tips, but that's was the first thing I did when setting up my box  :Smile:  sshd is running ok, that's not the problem. Problem is sftp-server don't come up and deal with my (s)ftp clients connect request...

my sshd_config have...

```
Subsystem       sftp    /usr/lib/misc/sftp-server
```

this was there by default setup. When trying to connect I get...

```
Winsock 2.0

connecting to me

connected to my.ip.go.here Port 22

SSH-1.99-OpenSSH_3.4p1

[color=red]Connection failed (Connection lost)[/color]
```

and there I stand...

[EDIT]

I checked the auth.log and it says...

```
Jul 24 02:22:19 ns1 sshd[26298]: Bad protocol version identification 'QUIT' from 212.3.0.176
```

Noticed when I open and log in with a pure sshd session the auth.log also have a (pam_unix) part like

```
Jul 24 02:14:32 ns1 sshd(pam_unix)[26268]: session opened for user me by (uid=1001)
```

could it be I need to have a pam setup for this as well?

----------

## kcsduke

Are you able to make a standard ssh connection?

From the man page (sshd_config):

Subsystem

Configures an external subsystem (e.g., file transfer daemon).  Arguments should be a subsystem name and a command to execute upon subsystem request.  The command sftp-server(8) implements the  ``sftp'' file transfer subsystem.  By default no subsystems are defined.  Note that this option applies to protocol version 2 only.

Which protocol are you using to connect?

I would try using the -v flag to increase the verbosity of your conntection attempt.  This will give you (and the people on the forum) more info on what might be going wrong.  With ssh you can you the -v flag three times for maximium verbosity (ssh man page).  I assume you can probably use it multiple times with sftp as well to further increase verbosity.

----------

## MoonWalker

 *Quote:*   

> Are you able to make a standard ssh connection? 

 

Yes, read above... and of course I have read the man pages  :Smile: 

```
Which protocol are you using to connect? 
```

With ssh I use ssh2, with ftp I'm not sure as I don't use sftp but connect from a Windows box using FlashFxp 2.0 - it's a new (beta) version and just had SSL implemented. There is 3 options "Implicite SSL", "SSL" and "TLS" the 2 later with suboptions "Secure File Listing" and "Secure File Transfer". It might be those are not fully working or have glitches and maybe better turn to the FlashFxp forum with the problem...

----------

