Key authentification with command line

Advertisement

p1c0
Joined:
Posts:
18
Location:
France

Key authentification with command line

Hi,

i try to use winscp3 with a script and it work well with user:password@server:port but i want to use key authentification...

Is it possible with command line? How should i proceed? :?

Thanks a lot in advance.

p1c0

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Key authentification with command line

You can create stored session with associated key and open that session.

The next version will allow passing of private key from command line.

Reply with quote

Guest

I've just try to do this but it doesn't work...

I have generated two key (public and private) with puttygen.exe. I have uploaded the public key on the box where i have the ssh server (openSSH-4.0p1) but when i try to start sshd, it can't read the key...

# /usr/sbin/sshd -h /etc/ssh/public_key -d
debug1: sshd version OpenSSH-4.0p1
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done : type <unknown>
Could not load host key: /etc/ssh/public_key
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting

I suppose that putty keys are not compatible with OpenSSH?!? Is there a solution?? Should i use an other ssh server?

Thanks a lot!

Reply with quote

martin
Site Admin
martin avatar

-h option is used to set key of the server, not of the user! Key of the user is usually stored into /home/username/.ssh/authorized_keys. You do not need to restart the sshd when you update the user keys.

Reply with quote

Advertisement

junknav
Guest

winscp commandline key authentication to an openssh server

HI GUys,

Can someone explain clearly how to make key authentication work with an openssh server. I have tried pageant. PuttyGen there was an option to convert the key but pageant doenst take that key.

I am doing something wrong.

Help!

Reply with quote

junknav
Guest

Re: winscp commandline key authentication to an openssh serv

junknav wrote:

HI GUys,

Can someone explain clearly how to make key authentication work with an openssh server. I have tried pageant. PuttyGen there was an option to convert the key but pageant doenst take that key.

I am doing something wrong.

Help!

SOrry! Figured out the problem. I has copy paste the openssh version 1 key which is displayed on the generate screen. Initially i was trying with key that i got from clicking the save public key button and then realized that my server is less than version 2

Reply with quote

Advertisement

You can post new topics in this forum