Fatal: unable to initialise SFTP: could not connect
Moderator: Project members
Fatal: unable to initialise SFTP: could not connect
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.
regards,
Lance Cooke.
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.
regards,
Lance Cooke.
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
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.
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
# $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
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
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
Resolution
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...