Fatal: unable to initialise SFTP: could not connect

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

Fatal: unable to initialise SFTP: could not connect

#1 Post by lc.cooke » 2007-07-09 22:05

Hi,

I have a linux box that has ProFTPD running on it with ssh and sftp enabled. I can ssh into the server with SSh(2) from my desktop no problem, and I can ftp into therserver as well with no problems. But when I try to sftp I get the error
Fatal: unable to initialise SFTP: could not connect
I have opened port 22 in my sshd_config file, and even tried to uncomment port 22 in my ssh_config file and none of it worke so far. Any help is much appreciated. :lol:

regards,

Lance Cooke.

User avatar
botg
Site Admin
Posts: 31659
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

#2 Post by botg » 2007-07-09 22:09

Please try most recent FileZilla 3 beta.

lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

#3 Post by lc.cooke » 2007-07-09 23:02

Thank you very much for your reply.
I am using FileZilla version 2.2.30 which I downloaded yesterday.

lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

#4 Post by lc.cooke » 2007-07-09 23:56

I downloaded FileZilla 3.0 BETA as per your instruction and this is the error I get when attempting to connect through port 22


Status: Connecting to ftp.<domain>.com :22...
Response: fzSftp started
Command: open <user>@ftp.<domain>.com 22
Command: Pass: *********
Status: Connected to <domain>.com
Error: Fatal: unable to initialise SFTP on server: could not connect
Error: Could not connect to server
Last edited by lc.cooke on 2007-07-10 01:52, edited 1 time in total.

lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

#5 Post by lc.cooke » 2007-07-10 01:46

I thought you may find this useful...its the contents of my sshd_config file

# $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

Port 22
Protocol 2
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600
#ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 120
PermitRootLogin no
StrictModes yes

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# rhosts authentication should not be used
#RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

#AFSTokenPassing no

# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no

# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no

#X11Forwarding no
X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
PrintMotd yes
PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

#MaxStartups 10
# no default banner path
#Banner /some/path
#VerifyReverseMapping no

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server

DenyUsers root
DenyGroups root

User avatar
botg
Site Admin
Posts: 31659
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

#6 Post by botg » 2007-07-10 10:42

I'd say your SFTP subsystem isn't configured properly. Can you please post a log with debug level 3? It should contain more information.

lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

#7 Post by lc.cooke » 2007-07-10 11:39

Thank you botg.
Here is what I get from FileZilla when I turn on debugging, it looks like the erver is issuing an exit command, not sure why...

Status: Connecting to ftp.<example.com>:22...
Response: fzSftp started
Trace: CSftpControlSocket::ConnectParseResponse(fzSftp started)
Command: open user@ftp.<example.com> 22
Trace: Looking up host "ftp.<example.com>"
Trace: Connecting to 208.109.253.133 port 22
Trace: Server version: SSH-2.0-OpenSSH_3.9p1
Trace: We claim version: SSH-2.0-PuTTY_Local:_Jun__3_2007_12:12:48
Trace: Using SSH protocol version 2
Trace: Doing Diffie-Hellman group exchange
Trace: Doing Diffie-Hellman key exchange with hash SHA-1
Trace: Host key fingerprint is:
Trace: ssh-rsa 1024 94:04:76:af:62:91:6e:89:f8:4a:dd:fb:5f:2a:e9:3e
Trace: Initialised AES-256 SDCTR client->server encryption
Trace: Initialised HMAC-SHA1 client->server MAC algorithm
Trace: Initialised AES-256 SDCTR server->client encryption
Trace: Initialised HMAC-SHA1 server->client MAC algorithm
Trace: Keyboard-interactive authentication refused
Command: Pass: *********
Trace: Sent password
Trace: Access granted
Trace: Opened channel for session
Trace: Started a shell/command
Status: Connected to <example.com>
Trace: Server sent command exit status 1
Trace: Disconnected: All channels closed
Error: Fatal: unable to initialise SFTP on server: could not connect
Trace: CSftpControlSocket::ResetOperation(66)
Trace: CControlSocket::ResetOperation(66)
Error: Could not connect to server

User avatar
botg
Site Admin
Posts: 31659
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

#8 Post by botg » 2007-07-10 13:29

lc.cooke wrote:Trace: Server sent command exit status 1
Confirms that there is a problem with the server configuration. Do other SFTP client work?

lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

#9 Post by lc.cooke » 2007-07-10 16:10

Hi, I agree...I used another client also got the same problem. Any ideas where I should look to fix this problem would be greatly appreciated.

lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

Resolution

#10 Post by lc.cooke » 2007-07-15 13:03

I found the solution to this if anyone is ever interested... its a rookie mistake I suppose that I made as a nubie. since sftp works over ssh, the user needs to have shell access. If you are new like me that means in your etc/passwd file the entry for the user with sftp access should have its last field set to bin/bash or some other shell as you please. The point is you can just turn any ftp user into an sftp user ...obvious in retrospect but like I said I am new...

lc.cooke
504 Command not implemented
Posts: 8
Joined: 2007-07-09 21:59

#11 Post by lc.cooke » 2007-07-15 13:05

Sorry, that last sentence should read "you CAN'T just turn any user...

User avatar
boco
Contributor
Posts: 24202
Joined: 2006-05-01 03:28
Location: Germany

#12 Post by boco » 2007-07-16 15:14

lc.cooke wrote:Sorry, that last sentence should read "you CAN'T just turn any user...
There is an 'Edit' button there for such mistakes, you know?

I have to use that button a lot... :oops:

Post Reply