Topic "Key authentification with command line"

Author Message
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
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? Confused

Thanks a lot in advance.

p1c0
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
You can create stored session with associated key and open that session.

The next version will allow passing of private key from command line.
_________________
Martin Prikryl
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...

Code:
# /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!
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
Sorry, i have forgotten to log in before post my reply! Confused
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
-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.
_________________
Martin Prikryl
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
Sorry, i've just found the solution!!

Now i'am searching about how to store a session... I will ask you if i don't find!! Smile
junknav

Guest


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!
junknav

Guest


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
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License