Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenSSH login with and without password

Status
Not open for further replies.

7280

MIS
Apr 29, 2003
331
IT
Hi,
I have installed OpenSSH 3.81 on a windows 2003 server.
I then configured a user to access with public/private keys from a linux server to that openssh server.
Everything works fine but now there's another windows system that needs to connect that openssh server.
This system is now accessing with a script that does pscp and passes the password.
Is it possible to still use this script but also do login without password from the linux system?

Thanks
 
Yes,

if a script passes credentials does not mean that you have to always pass credentials to a server.
The linux box can still use its set of keys and login.


QatQat

Life is what happens when you are making other plans.
 
Hi,
I'm able to connect from the linux system without any problem (keys are generated so password is not required).
If I try from the windows system with putty or pscp I'm not able to connect, error is:
No supported authentication methods left to try!
Lost connection

Now I'm trying to configure pscp in order to use keys but it's not working. I used puttygen.exe but I'm still not able to connect from windows. The error is the same reported above.
Any ideas?

Thanks again
 
have you converted the key using puttykeygen?

Pscp, as well as all software from the PuTTY suite, use a different format for the keys; if you generate a private/public pair from OpenSSH server you have to convert the private key using puttykeygen to create a .ppk file, compatible with windoz.

QatQat

Life is what happens when you are making other plans.
 
also note that openssh has an sshd.conf file that allows you to specify whether password-based authentication is permitted or whether key-only is allowed/required.

You can also specify whether 'root' is allowed to login at all, with a key, with a password.

D.E.R. Management - IT Project Management Consulting
 
Hi,
i've solved the problem.
Everything was ok, I was just missing an option while running pscp (-i private key file).

I still have a strange problem.
The exist code is always 0, even if there are errors, eg:
ssh remuser@remhost "ls -lart notexisting dir"
it returns 0.
If I run same command on another operating system (aix or linux) the return code is 1.

Thanks,
Tarek
 
Hi,
on another winzoz system I've installed copssh (instead of openssh).
copssh is returning me the correct "return code".
Since copssh as openssh are based on cygwin I'm not understanding what's the difference.
I've checked sshd_config and it's the same on the two systems.
I tried to debug both ssh connections:

copssh:
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug1: Sending command: exit 5
debug2: channel 0: request exec confirm 0
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 131072
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug2: channel 0: rcvd close
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cfd -1)

debug3: channel 0: close_fds r -1 w -1 e 6 c -1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.4 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 5


openssh:
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: ssh_session2_setup: id 0
debug1: Sending command: exit 5
debug1: channel 0: request exec
debug2: callback done
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 131072
debug1: channel 0: rcvd eof
debug1: channel 0: output open -> drain
debug1: channel 0: obuf empty
debug1: channel 0: close_write
debug1: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: rcvd close
debug1: channel 0: close_read
debug1: channel 0: input open -> closed
debug3: channel 0: will not send data after close
debug1: channel 0: almost dead
debug1: channel 0: gc: notify user
debug1: channel 0: gc: user detached
debug1: channel 0: send close
debug1: channel 0: is dead
debug1: channel 0: garbage collecting
debug1: channel_free: channel 0: client-session, nchannels 1
debug3: channel_free: status: The following connections are open:\015
#0 client-session (t4 r0 i3/0 o3/0 fd -1/-1)\015

debug3: channel_close_fds: channel 0: r -1 w -1 e 6
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0

The only thing that differs is:
copssh --> debug3: channel 0: close_fds r -1 w -1 e 6 c -1
openssh --> debug3: channel_close_fds: channel 0: r -1 w -1 e 6

Does this make sense for you?
Where do you think the problem can be?
Thanks again..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top