Operating System - HP-UX
1830203 Members
11603 Online
109999 Solutions
New Discussion

ssh not valid password...

 
SOLVED
Go to solution
Eberno
Regular Advisor

ssh not valid password...

My friends,

I have one user and I need to connect in other server. But I created a public key in my server and put in other server and not work...
Its need password
Please
Anybody help me???
5 REPLIES 5
Ivan Krastev
Honored Contributor

Re: ssh not valid password...

See this previous thread - http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1003395


Maybe you forgot to enable key authentication in sshd_server.

regards,
ivan
Bill Hassell
Honored Contributor
Solution

Re: ssh not valid password...

The most common error in adding a public key to a remote server is using vi and not turning off ai and setting wm=0. Each publickey is exactly one line long so check your .ssh/authorized_keys with the wc command. A proper file with 2 keys will have 2 lines:

wc -l /home/bill/.ssh/authorized_keys
2 /home/bill/.ssh/authorized_keys

So when you create a public key, it must be preserved as 1 line. If the key was created on a local server, you must transfer it to the remote server, either rcp or ftp, or copy-paste. If you copy the key as a file, verify that it arrived OK with the wc -l command. Then simply append the key to the authorized_keys file:

cat mykey >> .ssh/authorized_keys

Then verify the file has the right number of lines (1 for a single key, 2 for 2 keys, etc).

If you want to copy-paste the key, it gets fairly complicated. The reason is that your terminal emulator won't display exactly what is in the key. Most emulators will show only 80 or perhaps 132 characters in width, then either overwrite the last character (losing text) or automatically put the next characters on the next line(s). So you copy the text by highlighting it -- but the emulator you are using will very likely add a newline character after every line of characters. One exception is WRQ's Reflection for HP (NOT Reflection/X) where the option: Concatenate Wrapped Lines = yes will preserve long lines to the clipboard. You'll have to experiment with your emulator.

Once you copied a single line, you start vi on the remote machine and turn off end of line wrap with this commands:

:set noai wm=0

If the authorized_keys file already has keys, type G to go to the last line, then o to add a new line. Paste the line and type escape to finish. Before you close the file, press j and k to go up and down in the file. The cursor MUST move 1 key at a time, NOT 1 line at a time. Exit from the editor and verify that the file has the right number of lines with wc -l.

Very long lines require special handling, a case of what you see is not what you get.


Bill Hassell, sysadmin
Asif Sharif
Honored Contributor

Re: ssh not valid password...

Eberno
Regular Advisor

Re: ssh not valid password...

My friends,

I fixed my problem, was only permission in my home_directory,
The permission correcte is 750.

Thanks and points for all
Eberno
Regular Advisor

Re: ssh not valid password...

..