libssh2_userauth_publickey_fromfile_ex(3) [centos man page]
libssh2_userauth_publickey_fromfile(3) libssh2 manual libssh2_userauth_publickey_fromfile(3)NAME
libssh2_userauth_publickey_fromfile - authenticate a session with a public key, read from a file
SYNOPSIS
#include <libssh2.h>
int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session,
const char *username,
const char *publickey,
const char *privatekey,
const char *passphrase);
DESCRIPTION
session - Session instance as returned by libssh2_session_init_ex(3)
username - Pointer to user name to authenticate as.
username_len - Length of username.
publickey - Path name of the public key file. (e.g. /etc/ssh/hostkey.pub). If libssh2 is built against OpenSSL, this option can be set to
NULL.
privatekey - Path name of the private key file. (e.g. /etc/ssh/hostkey)
passphrase - Passphrase to use when decoding privatekey.
Attempt public key authentication using a PEM encoded private key file stored on disk
RETURN VALUE
Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a
negative number, it isn't really a failure per se.
ERRORS
LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
LIBSSH2_ERROR_SOCKET_TIMEOUT -
LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED - The username/public key combination was invalid.
LIBSSH2_ERROR_AUTHENTICATION_FAILED - Authentication using the supplied public key was not accepted.
SEE ALSO libssh2_session_init_ex(3)libssh2 0.15 1 Jun 2007 libssh2_userauth_publickey_fromfile(3)
Hi,
I have automated logins to Unix boxes with Ssh - Putty combination.
Have created a Pub - Pvt key combination for the same.
Added the entry of username in "User name" box of Putty.
This works perfectly for the specified user.
I want this to happen now for another user as well, without... (0 Replies)
Usually when su rejects an attempt to switch user it responds with "Sorry" but with a certain username on some unix servers the response is "Killed". I'm guessing the su accepted the username/password but refused to spawn child shell with the specified username. What's causing this and what has to... (8 Replies)
Hi,
I am running a script to scp a file from one server to another.
I have created the public/private key and copied the public key to the other server and appended it to authorized_key file.
But i am getting the error message saying "Host Key verification failed" Connection lost.
It works well... (3 Replies)
I've tried everything from changing permissions on the public and private keys to creating new keys and I still cannot authenticate my private key to another machines public key. Here is the ssh -vvv output:
ssh -vvv -i id_dsa account@x.x.45.137
OpenSSH_5.5p1, OpenSSL 1.0.0a 1 Jun 2010... (8 Replies)
hello,
iam able to ssh to a linux server from a linux server called "machine1" using the private/public key method, so I dont need to enter any password when I run my script but iam not able to ssh from machine1 to a UNIX server, access is denied.
note that I am using an application id which is... (6 Replies)
Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks.
... (1 Reply)