ssh public key auth "Remote login for account is not allowed" ?
Hello,
Using AIX 6.1 boxes.
User user1 connects from box A to box B using ssh.
When password authentication is used everything is fine. When I configure user1 to use public key authentication sftp client works fine(no password asked), but ssh client fails. This is sshd log:
To my understanding ssh authentication passes fine - something else in the way. I've done identical configs on linux boxes with no problems.
This is something AIX specific.
I did successful yestday as Porter's doc:
1. Create private/pub key on AIX:
$ssh-keygen -t identity
2. Get my private key from the AIX server, found in $HOME/.ssh/identity
Put that on Windows box.
I use WinSCP to transfer private key from AIX to Windows
3. Run puttygen.exe and... (8 Replies)
Hi Folks,
I am writing a shell script that can logon to remote machine automatically. But, I am facing one problem. I am using "ssh" command in script and while login into remote machine it asks for passowrd and it stops for STDIN input for password. I want my script to supply password... (2 Replies)
While trying to upgrade ssh from v4.7 to v5.0 on AIX 5.3 TL9, I end up with the following error.
Has anyone come across this?
Note: openssl has been upgraded to 0.9.8.840 before this upgrade
Bala (0 Replies)
Hi All,
When i try to do ssh from a linux to solaris box its throughing "Connection closed by remote host". Please not that this error is not occuring every time i do ssh, it occurs at random timing( Mostly ssh is successful) - unfortunately my script which is doing ssh is falling at this time... (4 Replies)
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
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)
Greetings!
I am trying to perform a passwordless SSH login from a HPUX 11.31 client to a HPUX 11.31 server. Whenever I do a "ssh -l root serverA" from the client, I am prompted for a password. Giving the password, I am able to successfully login. However I am trying to accomplish a... (9 Replies)
I need a shell script using expect to login to couple of remote servers and read "crontab -l -u <username>" & "cat /etc/rc.local" & "df -h" and able to create output into a file saved locally with hostname.crontab & hostname.rc.local & disk.status. I can supply a file as list of hostname or IP... (4 Replies)
Hi Guys,
When using plink ( plink -ssh $IP) to connect to an AIX box, the password is correct, but always after input the password and click enter I got "access denied", then I am promted for password again, this time no matter what password I give, correct or bad, after I re-click enter, as... (2 Replies)
I have a user account configuration with ssh public/private key that works on multiple servers centos and rhel. One server (Server F) that is not working in centos 6.8. When i ssh into server f I get prompted for a password. I have verified the config and it all is good. I put sshd into debug... (8 Replies)
Discussion started by: bash_in_my_head
8 Replies
LEARN ABOUT PHP
ssh2_auth_pubkey_file
SSH2_AUTH_PUBKEY_FILE(3) 1 SSH2_AUTH_PUBKEY_FILE(3)ssh2_auth_pubkey_file - Authenticate using a public keySYNOPSIS
bool ssh2_auth_pubkey_file (resource $session, string $username, string $pubkeyfile, string $privkeyfile, [string $passphrase])
DESCRIPTION
Authenticate using a public key read from a file.
PARAMETERS
o $session
- An SSH connection link identifier, obtained from a call to ssh2_connect(3).
o $username
-
o $pubkeyfile
- The public key file needs to be in OpenSSH's format. It should look something like: ssh-rsa AAAAB3NzaC1yc2EAAA....NX6sqSnHA8=
rsa-key-20121110
o $privkeyfile
-
o $passphrase
- If $privkeyfile is encrypted (which it should be), the $passphrase must be provided.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Authentication using a public key
<?php
$connection = ssh2_connect('shell.example.com', 22, array('hostkey'=>'ssh-rsa'));
if (ssh2_auth_pubkey_file($connection, 'username',
'/home/username/.ssh/id_rsa.pub',
'/home/username/.ssh/id_rsa', 'secret')) {
echo "Public Key Authentication Successful
";
} else {
die('Public Key Authentication Failed');
}
?>
NOTES
Note
The underlying libssh library doesn't support partial auths very cleanly That is, if you need to supply both a public key and a
password it will appear as if this function has failed. In this particular case a failure from this call may just mean that auth
hasn't been completed yet. You would need to ignore this failure and continue on and call ssh2_auth_password(3) in order to complete
authentication.
PHP Documentation Group SSH2_AUTH_PUBKEY_FILE(3)