Re: Setting up ssh from windows to linux using public key
- From: pitufo <vandresv@xxxxxxxxx>
- Date: Sat, 16 Jun 2007 17:42:03 -0700
On Jun 16, 3:15 pm, pitufo <vandr...@xxxxxxxxx> wrote:
I know nobody has asked me this, but It took me almost 3 hours of
reading, and googling the internet in order to have public key between
my Windows Notebook and my Linux home server. I don't want to forget
it and maybe I am helping someone else, so here I have my steps.
Client: Secure Shell 3.2 (windows O/S)
Server: OpenSSH 4,3 (linux O/S ...fedora core)
---From Windows:
--Connect to Linux using regular password authentication
--Edit Settings
User Authentication
Keys->Generate New (Next, you can change rsa, or dsa, and
the key length, or you can accept defaults)
Enter file name, and a passphrase if you want...I did not
use a passphrase, my laptop is secure enough as it is.
Finish.
-- Now you need to upload the public key just generated to the Linux
Server.
Click Upload button (if you are connected to Linux, the
file will be transfer)
Change Destination folder (secure shell offered me .ssh2, I
changed it to .ssh)
Authorization file will also be transfered to Linux
Click Upload.
--Now go to your linux box, (as the user you want to set up ssh public
key for)
cd $HOME/.ssh
Convert the public key from secure shell client to OpenSSH format:
ssh-keygen -f file_name_of_the_public_key -i >>authorized_keys
----
That's it....
Now you can close your secure shell session and start it again...it
won't ask for your password again (as I didnot use passphrase)(when
you use a passphrase, the passprhase does not travel the network, it
is just used by the client secure shell to open the ceritficate).
To use the ssh2.exe cli client command, do the following:
ssh2.exe -l username -i file_name_of_pub_key host
I am sorry for the roughness of the explanations, but it should work
in one shot.
Troubleshooting: if you are struggling with the connection do a tail -
f to /var/log/secure, it will hint you on where the problem is.
(remember to convert the format of the public key to OpenSSH format)
Good luck.
p.s: I intend to use this method to encrypt all network communication
of Net8 between Oracle and its clients.
I forgot something....the permissions on the ./ssh directory and the
files are very strict (if not sshd will complain and won't allow
connection).
chmod 600 $HOME/.ssh and chmod 7000 $HOME/.ssh/authorized_keys should
be good enough.
Another thing, secure shell for windows has a command prompt command
that can do the connection too using public key too:
One example that works for my case is this one:
ssh2 -l net8user -i ./net8user_dsa_2048.pub -L 1521:10.10.10.21:1521 -
L 1522:10.10.10.21:1521 10.10.10.21
net8user is the user in linux, 10.10.10.21 is the linux box IP , I
am creating to listening ports in 1521 and 1522 in the windows PC and
forwarding all requests to those ports towards 1521 of 10.10.10.21
where the oracle listener is waiting in port 1521
Now, I am only looking for a way to keep my ssh session alive during
the entire window session and I have my cheap version of Oracle
Advance Network in place.
.
- References:
- Prev by Date: Re: X.509 weakness?
- Next by Date: Re: X.509 weakness?
- Previous by thread: Setting up ssh from windows to linux using public key
- Index(es):