You are not logged in.

#1 2016-08-16 00:42:08

thewooster
Member
Registered: 2012-10-20
Posts: 57

SSH to Remote Server closes without asking for password

When trying to SSH to a remote host (not something I have physical access to) with my laptop (running arch and using openssh), I have no problem, the server asks for a password and I log in.

When trying to SSH to the same remote host with my desktop, the connection closes before even prompting for a password. I have tried using

ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@example.com -p 2222 -v

and it does not seem to matter.  My directory permissions are set per the arch wiki page.

Here is the output:

OpenSSH_7.3p1, OpenSSL 1.0.2h  3 May 2016
debug1: Reading configuration data /home/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to example.com[ip.64] port 2222.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.9
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.9 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to example.com:2222 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:KV1xS3Id2o4M8JD2CgYxa1L9nLLMBbKo7gZRQQ6mkLo
debug1: Host '[pwnable.kr]:2222' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:14
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Trying private key: /home/user/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey,password).

I've also tried clearing my .ssh folder and trying again . . . no luck. Thoughts?

Offline

#2 2016-08-16 00:46:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: SSH to Remote Server closes without asking for password

Compare the logs from the laptop and desktop.

Is it the same key for both clients?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-08-16 01:16:57

thewooster
Member
Registered: 2012-10-20
Posts: 57

Re: SSH to Remote Server closes without asking for password

Output from laptop.

OpenSSH_7.3p1, OpenSSL 1.0.2h  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to example.com [143.248.249.64] port 2222.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.9
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.9 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to example.com:2222 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:KV1xS3Id2o4M8JD2CgYxa1L9nLLMBbKo7gZRQQ6mkLo
debug1: Host '[example.com]:2222' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:3
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Trying private key: /home/user/.ssh/id_ed25519
debug1: Next authentication method: password
user@example.com's password:

Last edited by thewooster (2016-08-16 01:29:34)

Offline

#4 2016-08-16 01:26:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: SSH to Remote Server closes without asking for password

Sorry, I misread your first post: I thought you were wanting to authenticate with a key...

Does the desktop client conf have any key options in it?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2016-08-16 01:32:34

thewooster
Member
Registered: 2012-10-20
Posts: 57

Re: SSH to Remote Server closes without asking for password

Desktop client config is pretty sparse. My laptop does not have a config file in ~/.ssh/.

Host LANhost1
    port 22
    identityfile "/home/user/.ssh/desktop"
    user user
    hostname IP
Host LANhost2
    port 22
    user user
    hostname IP
Host LANhost3
    port 22
    user user
    hostname IP
Host github.com
    port 22
    User user
    HostName github.com
    IdentityFIle ~/.ssh/github

Offline

#6 2016-08-16 07:29:17

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: SSH to Remote Server closes without asking for password

Is LANhost1 the machine you're trying to ssh into? If that's the case the server is probably only accepting keys, and the password prompt you're getting is to unlock the key rather than the password for getting into the server.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#7 2016-08-16 21:21:23

thewooster
Member
Registered: 2012-10-20
Posts: 57

Re: SSH to Remote Server closes without asking for password

Unfortunately no. Everything in the file is on my local network.  The server I am trying to get to is a remote host outside of my network.  I only get the prompt when going from my laptop, and from there I am able to log in.  From my desktop I only get the failed errors listed.

Offline

#8 2016-08-16 21:40:43

thewooster
Member
Registered: 2012-10-20
Posts: 57

Re: SSH to Remote Server closes without asking for password

*Update* It must be something with my OpenSSH install.  I was just able to get to the remote host using the DropBear Client.

Offline

Board footer

Powered by FluxBB