Forums

Using ssh terminates immediately with exit code 254

Hi. I'm on Windows using MinGW to try and do a local forward of my mysql server on PythonAnywhere to my local machine (for testing and such). Here's my command and the output.

C:\home\Ben Zastawnik\.ssh>ssh -v -L 3306:luaweaver.pythonanywhere.com:3306 LuaW
eaver@ssh.pythonanywhere.com
OpenSSH_5.4p1, OpenSSL 1.0.0 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to ssh.pythonanywhere.com [23.21.200.247] port 22.
debug1: Connection established.
debug1: identity file /c/home/Ben Zastawnik/.ssh/id_rsa type 1
debug1: identity file /c/home/Ben Zastawnik/.ssh/id_rsa-cert type -1
debug1: identity file /c/home/Ben Zastawnik/.ssh/id_dsa type -1
debug1: identity file /c/home/Ben Zastawnik/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2p2 Ubunt
u-6ubuntu0.3
debug1: match: OpenSSH_6.2p2 Ubuntu-6ubuntu0.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'ssh.pythonanywhere.com' is known and matches the RSA host key.
debug1: Found key in /c/home/Ben Zastawnik/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
<<<<<<:>~ PythonAnywhere SSH. Help @ https://www.pythonanywhere.com/wiki/SSHAcce
ss
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /c/home/Ben Zastawnik/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /c/home/Ben Zastawnik/.ssh/id_dsa
debug1: Next authentication method: password
LuaWeaver@ssh.pythonanywhere.com's password:
debug1: Authentication succeeded (password).
debug1: Local connections to LOCALHOST:3306 forwarded to remote address luaweave
r.pythonanywhere.com:3306
debug1: Local forwarding listening on 127.0.0.1 port 3306.
debug1: channel 0: new [port listener]
debug1: channel 1: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: client_input_channel_req: channel 1 rtype exit-status reply 0
debug1: client_input_channel_req: channel 1 rtype eow@openssh.com reply 0
debug1: channel 1: free: client-session, nchannels 2
debug1: channel 0: free: port listener, nchannels 1
Connection to ssh.pythonanywhere.com closed.
Transferred: sent 2104, received 2880 bytes, in 1.1 seconds
Bytes per second: sent 1873.6, received 2564.6
debug1: Exit status 254

Any ideas? I feel like there's an obvious mistake.

For what it's worth, probably very little, I can confirm that I'm connecting OK to port 22 at ssh.pythonanywhere.com this morning using a Windows FTP client. I'm not aware of any recent issues with this.

Jim

@LuaWeaver -- that's because you have a free account, SSH access is only enabled for paid accounts.

Oh, I feel stupid now. Well, damn. Guess I'll just have to run two servers then.