Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Putty closes after authentication with public key

2,735 views
Skip to first unread message

aramos...@gmail.com

unread,
Sep 30, 2013, 7:17:45 AM9/30/13
to
Hi guys,

I'm running Putty in Windows 7 32 bits against an OpenSSH server in Windows 2003. I can login sucessfully using user and pwd authentication, but when I change to RSA I'm not able to do it.

Keys were created using PuttyGen and deployed in the server, in fact, Putty is doing the login but it closes after that without warning.

I can see this in Putty log:

--->

Authenticating with public key "rsa-key-20130925 for Takion SSH server"
Last login: Mon Sep 30 13:09:38 2013 from 210.red-88-26-204.staticip.rima-tde.net

--/>

So, I think that login was done sucessfully.

Could you please help me?

Many thanks

Jacob Nevins

unread,
Oct 1, 2013, 8:57:44 AM10/1/13
to
aramos...@gmail.com writes:
>I'm running Putty in Windows 7 32 bits against an OpenSSH server in
>Windows 2003. I can login sucessfully using user and pwd
>authentication, but when I change to RSA I'm not able to do it.

What version of PuTTY?

>Keys were created using PuttyGen and deployed in the server, in fact,
>Putty is doing the login but it closes after that without warning.

Try changing "Close window on exit" to "Never", then look at the PuTTY
Event Log (which you can get to from the system menu on the PuTTY
terminal window, or the Ctrl+right-click menu).

>I can see this in Putty log:
>
>--->
>
>Authenticating with public key "rsa-key-20130925 for Takion SSH server"
>Last login: Mon Sep 30 13:09:38 2013 from
>210.red-88-26-204.staticip.rima-tde.net
>
>--/>
>
>So, I think that login was done sucessfully.

I agree that looks like a successful login (in particular, the "Last
login:" bit looks like the first bit of the login session sent by the
server).

The only thing I can think of offhand, given your symptoms, is a forced
command associated with the key in the server-side configuration that
terminates immediately, but you'd presumably know if you'd set that up.

aramos...@gmail.com

unread,
Oct 1, 2013, 10:38:18 AM10/1/13
to
Thanks,

Putty version is release 0.63

Event log:

2013-10-01 16:35:50 Looking up host "82.223.246.143"
2013-10-01 16:35:50 Connecting to 82.223.246.143 port 22
2013-10-01 16:35:50 Server version: SSH-2.0-OpenSSH_3.8.1p1
2013-10-01 16:35:50 Using SSH protocol version 2
2013-10-01 16:35:50 We claim version: SSH-2.0-PuTTY_Release_0.63
2013-10-01 16:35:50 Doing Diffie-Hellman group exchange
2013-10-01 16:35:50 Doing Diffie-Hellman key exchange with hash SHA-1
2013-10-01 16:35:50 Host key fingerprint is:
2013-10-01 16:35:50 ssh-rsa 1024 a3:fa:5d:e6:d3:b7:bf:6d:e5:6d:85:61:f2:7d:c7:82
2013-10-01 16:35:50 Initialised AES-256 SDCTR client->server encryption
2013-10-01 16:35:50 Initialised HMAC-SHA1 client->server MAC algorithm
2013-10-01 16:35:50 Initialised AES-256 SDCTR server->client encryption
2013-10-01 16:35:50 Initialised HMAC-SHA1 server->client MAC algorithm
2013-10-01 16:35:50 Reading private key file "D:\Doc_Takion\PuTTy\aramos_TakionSSH.ppk"
2013-10-01 16:35:50 Pageant is running. Requesting keys.
2013-10-01 16:35:50 Pageant has 1 SSH-2 keys
2013-10-01 16:35:50 Pageant key #0 matches configured key file
2013-10-01 16:35:51 Writing new session log (raw mode) to file: D:\Doc_Takion\PuTTy\putty.log
2013-10-01 16:35:51 Trying Pageant key #0
2013-10-01 16:35:51 Sending Pageant's response
2013-10-01 16:35:51 Access granted
2013-10-01 16:35:51 Opening session as main channel
2013-10-01 16:35:52 Opened main channel
2013-10-01 16:35:52 Allocated pty (ospeed 38400bps, ispeed 38400bps)
2013-10-01 16:35:52 Started a shell/command
2013-10-01 16:35:52 Server sent command exit status 255
2013-10-01 16:36:02 Disconnected: All channels closed

Server is OpenSSh but I didn't set any command associated with the key :(

Do you know what thing could be happening?

Thanks

aramos...@gmail.com

unread,
Oct 1, 2013, 10:48:40 AM10/1/13
to
Server event viewer has this info:

Event Type: Error
Event Source: sshd
Event Category: None
Event ID: 0
Date: 01/10/2013
Time: 16:35:53
User: NT AUTHORITY\SYSTEM
Computer: CD75665
Description:
The description for Event ID ( 0 ) in Source ( sshd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: sshd : PID 2300 : fatal: setreuid 1011: Permission denied.

Jacob Nevins

unread,
Oct 1, 2013, 3:52:12 PM10/1/13
to
aramos...@gmail.com writes:
[PuTTY log]
>2013-10-01 16:35:52 Started a shell/command
>2013-10-01 16:35:52 Server sent command exit status 255
>2013-10-01 16:36:02 Disconnected: All channels closed

[and on the server]
>Server event viewer has this info:
[...]
>sshd : PID 2300 : fatal: setreuid 1011: Permission denied.

That convinces me that the problem is on the server, but I've no idea
why that might be happening.

It looks like you're running your SSH server on Windows? Could it be
something like, the SSH server is unable to start a session as the
relevant user without having the user's actual credentials (password) in
hand? (Complete guess; I have no experience running an SSH server on
Windows.)

Mr. Man-wai Chang

unread,
Oct 2, 2013, 8:15:14 AM10/2/13
to
> Keys were created using PuttyGen and deployed in the server, in fact,
> Putty is doing the login but it closes after that without warning.

Do you have a ~/.ssh/authorized_keys at the Linux side?

I suggest you use ssh-keygen at the Linux side to generate the keys!

Use puttygen to convert OpenSSH private keys into putty format!

--
@~@ Remain silent. Nothing from soldiers and magicians is real!
/ v \ Simplicity is Beauty! May the Force and farces be with you!
/( _ )\ (Fedora 19 i686) Linux 3.11.2-201.fc19.i686
^ ^ 20:00:02 up 18:12 0 users load average: 0.00 0.01 0.05
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa

nasiqhsh...@gmail.com

unread,
May 30, 2014, 2:59:43 AM5/30/14
to
Can anyone please help me write a script which logs in to a putty session and enters username and password and then execute commands?

I am half way through . I have written following .bat script
@echo off
start C:\User\XYZ\Desktop\putty.exe -load "session" -l "username" -pw "password";
But it closes after authenticating.
Please help me in the above issue and also a way to execute commands automatically after loggin in.

Thanks in advance.
0 new messages