03-25-2008
Two key questions here:
1) Is the remote user account accessible and in sync with the password you're trying to use? We often see these due to passwords having expired, etc. (Authentication's intact but only so long as the account is viable;
2) Are you certain that it's not prompting you for a Passphrase instead of a password? If your public key file was not generated with an empty passphrase session authentication will be forced to prompt you for an input on this..negates your automation somewhat.
Lastly, if your client is using SSH2 (Tectia, for example) and your host server is using SSH (OpenSSH, for example), then you'd need to convert the key formats to fit.
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi
when i execute the below command
sftp -b ftpCommand.ksh remoteuser@remoterserver
i am getting the error "-b requires an argument greater than zero"
Please can any one help me. (1 Reply)
Discussion started by: vgs
1 Replies
2. Shell Programming and Scripting
Hi
when i execute the below command
sftp -b ftpCommand.ksh remoteuser@remoterserver
i am getting the error "-b requires an argument greater than zero"
Please can any one help me. (4 Replies)
Discussion started by: vgs
4 Replies
3. Shell Programming and Scripting
Thanks to the help from this forum i've learned a lot of good stuff but I still have questions :).
I need to write a script that checks if ssh to a box requires a password. I need it will be an "if" statement, if ssh requires password, then do a key exchange(with i already have). Just need to... (5 Replies)
Discussion started by: elbombillo
5 Replies
4. Shell Programming and Scripting
Hi team,
I know if we need to transfer the files between between 2 servser, we use SFTP through key setup between 2 server.
currently There are some problems and we are not able to setup keys between servers.
How can i use password with SFTP for temporary solutions, so that the file... (6 Replies)
Discussion started by: Amit.Sagpariya
6 Replies
5. Shell Programming and Scripting
Hi
i have generate public private key pair using command
ssh-keygen -t rsa -b 2048
and then it made the two keys under the directory
~/.ssh ( in server 1)
one is public key and another one is private ..
i copied public one key onto my second server under the directory
... (22 Replies)
Discussion started by: aishsimplesweet
22 Replies
6. Shell Programming and Scripting
Hi Guys,
I need to know how can i achieve SFTP "with" password in a shell script.
I have already done passwordless key generation thing and it is working but at the moment i am interested in passing a password.
And another question I have is say i have a.ksh and b.sh scripts...Can i invoke... (6 Replies)
Discussion started by: Arpit Narula
6 Replies
7. Red Hat
There are two servers :
1. Site
2. Testing
from site server i want to connect testing server with ssh password less authentication.
i generated public and private keys with ssh-keygen -t rsa on site server.
cat id_rsa >> authorized_keys
cat id_rsa.pub >> authorized_keys
i... (15 Replies)
Discussion started by: rehantayyab82
15 Replies
8. Shell Programming and Scripting
Hi All,
I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup.
I am working on Solaris 10.
Here is the code.
#!/bin/ksh
# sample automatic Sftp script to dump a file
USER="user1"
PASSWORD="pass1"
HOST="host1"
sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies
9. Shell Programming and Scripting
I have been tasked with scripting a sftp transfer from my clients sftp server to a vendor. I have been given a user name and password. This is an older OEL server, 5.2. I am not able to install any packages on this system. It does not have expect, ssh-pass, or any other ssh password helper... (6 Replies)
Discussion started by: mtrgoose
6 Replies
LEARN ABOUT DEBIAN
libssh2_userauth_publickey_fromfile_ex
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 - Remote user name to authenticate as.
username_len - Length of username.
publickey - Path and name of public key file. (e.g. /etc/ssh/hostkey.pub)
privatekey - Path and name of private key file. (e.g. /etc/ssh/hostkey)
passphrase - Passphrase to use when decoding private key file.
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)