LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-31-2003, 09:01 PM   #1
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Rep: Reputation: 31
SSH rejects my host key for version 2 only.


I'm trying to get ssh to run, but when I run sshd, is says "Disabling protocol version 2. Could not load host key." I have it set for both SSH1 and SSH2, and before I fixed another problem, it said:

Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key

So I figure that when it leaves out "Disabling protocol version 1" it means version 1 works. According to "man sshd" the HostKey directive sets the key for both SSH1 and SSH2.

Why does only version 1 work?
 
Old 08-01-2003, 05:19 AM   #2
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
you may have enabled protocol version 2, but did you generate the public/private keys to go with it? if not, it won't work.

Protocol 1 works because the keys are generated automatically when the machine is installed for the first time (or when SSH is installed for the first time).

let me know if you already generated SSH keys for Protocol 2 or not... if you didn't, i'll tell ya how
 
Old 08-01-2003, 01:41 PM   #3
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
As far as I know ssh-keygen is the way to create keys. You're saying there's another one? I wish my book would have told me that. How do you create keys for SSH2?
 
Old 08-01-2003, 04:24 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Look in /etc/ssh. Typically there are 3 sets of keys. If you don't have them, then generate the missing ones using:

ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
 
Old 08-01-2003, 06:05 PM   #5
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
Hey, it works! - sort of. After I did all that with the keys, I logged, and it never did a thing afterwords. It didn't even give me a prompt. The log for my SSH client said that the login was successful. Now when I try to log in it does nothing until the connection times out. What's wrong now?
 
Old 08-04-2003, 05:34 AM   #6
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
can you post the output from your terminal? it's kinda difficult to see what's happening without the output...

sounds like the daemon isn't running though, if ur getting connection refused...
 
Old 08-04-2003, 09:51 AM   #7
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
It's like this:

login: root
password:<password>
<nothing....>

And that's about as far as it gets. When I try to log in again, it never responds. Once it did this:

login: root
<nothing.....>

It's strange.
 
Old 08-04-2003, 09:55 AM   #8
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
that is a bit strange... i'm not sure why it's asking for a "login:" though... ssh doesn't normally do that ...unless you are using PuTTY on a windoze machine, of course

how long did you wait before determining that it was indeed doing *nothing*?? i can take a minute or two very occasionally. i would wait for as long as it takes to get an error message if i were you.
 
Old 08-04-2003, 11:07 AM   #9
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
Well, now that you mention it, I am using PuTTY.

When the connection isn't working right, I just wait and wait until a box pops up that says the connection timed out.
 
Old 08-04-2003, 05:37 PM   #10
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
hmm.... very strange.... with PuTTY, it does the following steps:

1. PuTTYonnects to TCP/IP port.

2. PuTTY prompts for username.

3. PuTTY sends username to server, and waits for password prompt response.

From this point on, PuTTY isn't doing anything except displaying what the remote server throws at it.

Therefore, the password prompt comes from the SSH server you are connecting to... which indicates that the daemon is working and running.

I have absolutely no idea why it times out after logging in though. Have you tried creating a new normal user account, and using that to log in with? it could be a weird issue with your own user account.
 
Old 08-04-2003, 07:22 PM   #11
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
Well, I forgot my normal account's password, so I had to do a little cutting and pasting before I could log in with that account. It went a bit farther this time. The output was as follows:

login: travis
password:<password>
Last login on <whenever>
<nothing....>

It never told me my last login before. I tried it again, and it didn't do anything. Now what should I do?
 
Old 08-05-2003, 03:14 AM   #12
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
ok... a possible reason for it not working before was that you were logging in as root.... (that's how i read it anyhow) remote logins as root are not permitted on most machines.

when you say it logged in fine with user 'travis', you said it told you your last login, but then did nothing... what do you mean "nothing"?? did it give you an error? did it time out? did PuTTY display a dialog box?
 
Old 08-05-2003, 10:15 AM   #13
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
"Nothing" means it sits there, the cursor blinks, and eventually PuTTY pops up a little box telling me that the connection timed out.

I don't see why it wouldn't like root logins. I've got EnableRootLogins set to "yes". Is there something else I should do so that it will be happier with root logins?
 
Old 08-05-2003, 10:52 AM   #14
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
nah... that's all u need to do to enable remote root logins. it's not recommended though, of course

as for it timing out... it sounds like your daemon is crashing, maybe... it is active to begin with (cos it asks for your password), but then it times out, so i think it's hanging or crashing.
does your machine have a *really* high load on it, or did you compile the SSH daemon yourself??

 
Old 08-05-2003, 04:41 PM   #15
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
SSH installed when Linux installed, and I'm the only one accessing my PS2. It isn't even hooked up to the Internet.

However, I was thinking that since the Playstation 2 probably has the biggest ratio of CPU power to RAM (~5 Gigaflops/32 Mb), I'd try it without X running. It got a little bit further this time. The output is as follows:

login as: travis
travis@10.0.0.3's password:
Last login: Mon Aug 4 19:04:20 2003 from 10.0.0.2
[travis@pstwo travis]$ ls -al
total 152
drwx------ 12 travis travis 4096 Aug 4 18:54 .
drwxr-xr-x 7 root root 4096 May 22 19:58 ..
-rw------- 1 travis travis 0 May 23 18:59 .ICEauthority
-rw------- 1 travis travis 99 Aug 4 18:50 .Xauthority
-rw-r--r-- 1 travis travis 4846 May 22 19:58 .Xdefaults
-rw------- 1 travis travis 160 Aug 4 21:43 .bash_history
-rw-r--r-- 1 travis travis 24 May 22 19:58 .bash_logout
<nothing....>

Then after about five seconds, it said "Connection reset by peer." You can see that it says "total 152", so it didn't even finish "ls -al" before it quit.

A 286 could probably do SSH and X at the same time without crashing, so I doubt this is the matter.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh Host Key ziox Linux - Networking 6 02-07-2005 02:57 PM
How to setup a host.deny and host.allow for SSH? explorer1979 Linux - Security 2 01-31-2005 05:28 PM
to 2.6.10 from 2.4.26 | ssh client | Host key verification failed kaN5300 Slackware 6 01-05-2005 10:04 PM
sshd - host key jamna17 *BSD 3 06-16-2004 08:20 AM
sshd won't read my host key Travis86 Linux - Networking 0 07-30-2003 10:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration