1. on the source host do generate private/public key pair
for example:
ssh-keygen -t rsa
(press twice enter when it asks for:
(1) key location and
(2) password choosing
2. go to destination host/user - in your case: stg@10.90.1.42
create directory ~stg/.ssh with mode 700, then create file ~stg/.ssh/authorized_keys (mode 644) containing the line from the identity.pub (public key) got from source host/user
Next, test it running "ssh stg@10.90.1.42 date" on source host. In the result, you shouldn't be prompted for password.
I have done these procedure, but still it is prompting for passwd
I run this in source host
test:/# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
26:83:1e:b0:74:f8:02:30:cb:c6:6b:99:e1:87:8d:8f root@test.ask.com
I have copied the containt of /root/.ssh/id_rsa.pub from source to destination /stg/.ssh/authorized_keys
In the source
test://root# sftp stg@10.90.1.42
Connecting to 10.90.1.42...
The authenticity of host '10.90.1.42 (10.90.1.42)' can't be established.
RSA key fingerprint is 58:47:72:ca:e1:e1:35:f1:a9:fd:ad:b2:dc:b5:f6:f2.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.90.1.42' (RSA) to the list of known hosts.
Connection closed by 10.90.1.42
Connection closed
test1:~/.ssh# sftp stg@10.90.1.42
Connecting to 10.90.1.42...
The authenticity of host '10.90.1.42 (10.90.1.42)' can't be established.
RSA key fingerprint is 58:47:72:ca:e1:e1:35:f1:a9:fd:ad:b2:dc:b5:f6:f2.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '10.90.1.42' (RSA) to the list of known hosts.
stg@10.90.1.42's password:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.