Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

SSH through PuTTY

A person sent me the public & private keys as a text file for connecting via SSH to a Linux server.

Obviously, I don't want to put that file here. But it's structure is like the attached.

I have Win 7; I tried to use Putty key generator. It says "Couldn't Load private key; not a private key".

What can I do?

Thanks
Sample.txt
ASKER CERTIFIED SOLUTION
Avatar of Codrut Tambu
Codrut Tambu
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Korts

ASKER

There is NO WAY to create a new session!!

See attached. I can see NO new session option, I cannot type anything into that text box.

Please provide PRECISE details.

Thanks
putty.jpg
Avatar of Dave Baldwin
The Precise detail is that you type a name for the session in the box under Saved Sessions and click on Save.
Look at the image I've attached...  write the session name in the place I wrote  <SESSION NAME>, after you press save for the 1st time, the session name will go in the list below.

After that, go to SSH > Auth load key, and before pressing open, just press SAVE again to update the changes.

Just let me know if you've managed it.
OK, I did that, then clicked SSH, Auth & get attached.

There is no Load Key.
putty2.jpg
If you've followed right all the steps, than you just press load (session) - the button in the image you've attached and than OPEN ... and is all done.
Next you'll see the dialog with the server-fingerprint and after the ssh console.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Richard, have you loaded the private key, by pressing browse on the SSH > Auth (in the left-hand-side tree menu) like  in the image?
User generated image
OK... Looking at the txt file example you have it looks like whoever generated the key pair in puttygen just copy/pasted the info into a txt file instead of using that program to export the public and private keys...
I generated a test key pair so you can look at the proper format of the public and private keys. They are not real keys in use, but you can see the layout.
testkey1.ppk.txt
testkey1.pub.txt
Richard, what extension have the file you've received .txt or .ppk ???
If it's a .ppk file you can load it directly in Putty, as I've mentioned above.

If not you need to tell me if the file contains those blank line between 1st and 2nd line .... and if it does, you need to delete the blank lines and save the file as ppk
To All:

THanks for all the inputs; does not work.

(1) The file I received was a .txt with those blank lines.

(2) I removed the blank lines so it looked like what scott silva said, saved as a .ppk file.

(3) Opened putty. It does not remember the IP address, I have to copy it from another source EVERY time. Annoying but OK.

(4) On Auth, on the private key file, I browsed to the file & clicked open.

I get the attached.
Image3.jpg
Is SHH even turned on at the server? Is it set to a standard port?
Is the firewall set to allow ssh connections?

Here is a good step by step tutor on using putty
http://www.electrictoolbox.com/article/applications/ssh-putty/
(1) You need a correct .ppk file - maybe ask it from your friend again in the correct format.

(2) That's good. Check for extra white_spaces to assure you have a correct .ppk file

(3) IF you have saved the session in the previous step, than you should press load when opening putty and that will show you the saved IP.

(4) The error can be caused because by the wrong port... from that screen-shoot you have no connection to the server.

Please ask your friend to send you again the server port and .ppk file and to check if port is 22, than ask him to either check if ssh is turned on or if the server accepts connections from your IP.
Have you just tried renaming the text file you received to a .ppk file?
@serialband: that can be a solution after he solves the server connection issue.

The server must accept connections before checking for the PrivateKey. From the last screenshot, there is no connection with the server on the session initiated on port 22. This can be caused by either by a wrong port number, firewall restriction, or ssh service can be down.
I give up. I finally got an ftp connection to work.

Another person connects this way with SSH all the time.

But thanks for your efforts.
The problem is NOT solved.

Points awarded for effort
Telnet to the server in question to see if the ssh port is open to you.  It should respond with some initial plain text information about the server.

telnet server_name 22
As the poster was told, either that port is turned off, ssh isn't running, or he is on the wrong side of a firewall rule or a hosts.allow/hosts.deny rule... Just because "someone else can do it" doesn't mean everyone can...
The telnet would help in determining that.  The location of the remote linux server was never determined.  Was the server accessible from the internet?  Where is the other user connecting from when they connect to the ssh port.  Maybe a VPN is needed to connect to the ssh port.  There's a lot of unknowns that have been left out.