Showing posts with label putty. Show all posts
Showing posts with label putty. Show all posts

Wednesday, July 1, 2015

Converting .ppk to OpenSSH

PuTTY Private Key (.ppk) could be exported to an OpenSSH key allowing it to be used with an OpenSSH client on linux terminal.
1. The private key contained within the ppk is exported to OpenSSH with the use of puttygen.exe
2. Run puttygen.exe and load the existing private key file

Same could be achieved on command line with
puttygen.exe puttykey.ppk  -O private-openssh
When the file is loading it will prompt for the passphrase.
3. Once the correct passphrase is entered the private key will be loaded.

4. Select "Export OpenSSH key" item under the conversions menu and save the key.

5. Copy the key file to linux server to be be used with the OpenSSH client.



6. Change the protection of the key file to 400. Without it ssh client will issue the following warning and will not connect.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'myssh.key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: myssh.key
Once the file permission is changed, it could be used with the OpenSSH client.
chmod 400 myssh.key
$ ssh oracle@dbserver  -p 2356 -i myssh.key
Enter passphrase for key 'myssh.key':

Thursday, November 27, 2014

Tunneling VNC Over SSH Using PuTTY

By default VNC runs on port 5901. This port may not always be open for access. Vnc access maybe needed for GUI base work such as runInstaller, DBCA, DBUA etc. (there are other ways to get GUI to desktop, such as Xming). In situation where VNC port is not open it could be tunneled over SSH. This post shows how to use PuTTY for this effect.
1. Set the tunneling information before opening the ssh connection. Source port is the local listening port. In this case port 5999 has been chosen as the local listener port. Destination is a host:port combination. In this case the local host is the destination host and port is set 5901 which the remote vnc listening port.
2. Once Click add to make the tunneling take effect when ssh connection is established.



3.Establish the ssh connection.
4. Connect a vncviwer specifying the source port used earlier.
If the source port had been 5901 (the default vnc port) then the vncviwer connection could use the following