How to connect remote Linux host using passwordless private key authentication?

Hello,

I am having openSUSE 13.2 64bit vm.
I want to connect to remote Linux host using private & public keys.
Private & Public key is given to me in PPK format.
I tried to convert them to id_rsa & id_rsa.pub format. Copied these files under /home/user/.ssh/ dir
I also need to use tunneling too. When I fire the command it still asks for password. Command I am using =

ssh -i /home/<user>/.ssh/authorized_keys -f <user_name>@<remote_host_public_ip> -L 8111:<LAN_IP_of_Remote_host>:8111 -N

If I link PPK private cert in PuTTY [in Windows OS] & if I specify tunneling it connects to remote Linux host without prompting for password.

Any help?
Thanks.

Regards,
Amey.

You only need to have id_rsa (your private key) in your .ssh directory with permissions 600 and then you won’t need to use the -i parameter at all and by the looks of it, you are trying to use your public key as the private key.

> Code:
> --------------------
> ssh -i /home/<user>/.ssh/authorized_keys -f <user_name>@<remote_host_public_ip> -L 8111:<LAN_IP_of_Remote_host>:8111 -N
> --------------------

This line is wrong; the authorized_keys file is for the server (vs.
client) side of the connection. Specifying this file on the client side
is almost certainly the problem. Point to an actual key file (vs. a file
holding multiple remote keys) and you should do better.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

We had a talk on something similar at our LUG in November - see http://www.bradlug.co.uk/november-17-2014-couchdb-cap-theorem-passwordless-proxy-server-capacitor-plague-and-mpd/

Very nice.

A couple things about SSH proxying (warning, thread drift): browsers (and
other clients) will use it for their HTTP/HTTPS/etc. connections, but may
not always use it for things like DNS requests preceding those. There are
options, such as in Firefox, to change that behavior so that DNS requests
also go through the proxy, but last time I checked they were not on by
default. The biggest concerns here are that those who own your network
(public store, airport, relatives) may see domains you are requesting,
even if they cannot see anything else.

Also, came across this article today on enhancing SSH security which I am
trying to incorporate into my new standard operating procedure to prevent
bad guys from snooping more than they should:

https://stribika.github.io/2015/01/04/secure-secure-shell.html


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…