LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-21-2006, 06:33 AM   #1
Roxxor2
LQ Newbie
 
Registered: Mar 2006
Posts: 23

Rep: Reputation: 15
How to start SSH daemon in Ubuntu?


How do I start SSH server?

I have emigrated from Gentoo (Im still using it too by the way) and there I just have to start sshd. But there is not sshd program so my quesition is how I start a ssh dameon so I can connect to this computer.

I just have /etc/init.d/ssh
not sshd (as in Gentoo).

I have run
Code:
sudo apt-get install ssh
and
Code:
sudo apt-get install openssh-server
What's wrong?

Last edited by Roxxor2; 03-21-2006 at 06:35 AM.
 
Old 03-21-2006, 09:39 AM   #2
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417

Rep: Reputation: 53
On gentoo, the /etc/init.d/ssh startup script IS the sshd startup script. You should just have to do an "/etc/init.d/ssh start" and sshd should be running.
 
Old 03-21-2006, 11:22 AM   #3
Roxxor2
LQ Newbie
 
Registered: Mar 2006
Posts: 23

Original Poster
Rep: Reputation: 15
Ok, here I go:
Code:
roxxor@laptop:~$ sudo /etc/init.d/ssh start
 * Starting OpenBSD Secure Shell server...               
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.      [fail]
What's wrong and how can I solve it?
 
Old 03-21-2006, 03:17 PM   #4
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417

Rep: Reputation: 53
Looks like the host keys were never generated for some reason. You need to do something along the lines of the following to generate those keys, then restart the service:

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
 
Old 03-23-2006, 05:50 AM   #5
Roxxor2
LQ Newbie
 
Registered: Mar 2006
Posts: 23

Original Poster
Rep: Reputation: 15
Code:
roxxor@laptop:~$ sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
Generating public/private rsa key pair.
/etc/ssh/ssh_host_rsa_key already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@laptop
Code:
roxxor@laptop:~$ /etc/init.d/ssh start
 * Starting OpenBSD Secure Shell server... Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.           [fail]
 
Old 03-23-2006, 06:26 AM   #6
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 38
Could it be that you aren't root when starting ssh?
try:
Code:
sudo /etc/init.d/ssh start
actually changing user with su first, probably gives you some more info when starting the ssh server.
 
Old 03-23-2006, 06:28 AM   #7
Roxxor2
LQ Newbie
 
Registered: Mar 2006
Posts: 23

Original Poster
Rep: Reputation: 15
Then I just get
Code:
roxxor@laptop:~$ sudo /etc/init.d/ssh start
Password:
 * Starting OpenBSD Secure Shell server...       [fail]


EDIT:

I don't know if this is a bug, but look:
Code:
roxxor@laptop:~$ sudo /etc/init.d/ssh start
* Starting OpenBSD Secure Shell server... [fail]
roxxor@laptop:~$ sudo /etc/init.d/ssh restart
* Restarting OpenBSD Secure Shell server... [ ok ]
roxxor@laptop:~$ sudo /etc/init.d/ssh stop
* Stopping OpenBSD Secure Shell server... [ ok ]
roxxor@laptop:~$ sudo /etc/init.d/ssh start
* Starting OpenBSD Secure Shell server... [ ok ]
Any comments?

Got the solution from here: http://www.ubuntuforums.org/showthre...=100934&page=2

Last edited by Roxxor2; 03-23-2006 at 06:38 AM.
 
Old 03-23-2006, 08:20 AM   #8
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417

Rep: Reputation: 53
Well... for that last set of stuff where you are starting and stopping the service, it looks like the following was already occurring:

1st: The sshd daemon was already running, so starting it again fails (Oooh! A smart startup script! Nice!)
2nd: Since it is restarting it, it found the old process, stopped it, then started it again. No problems!
3rd: Hey, it was still running from when you restarted it, so stopping it is no problem now.
4th: Well, you did just stop it in 3, so starting it now works like a charm.

At this point, you should be able to ssh into the machine without issue, since the sshd daemon is running. If you can't, I would say that you have an issue somewhere else, perhaps a firewall or something going on.
 
Old 03-24-2006, 07:55 AM   #9
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 38
So, how can you tell whether the ssh daemon is running or not? (as root) try
Code:
rcsshd status
 
Old 03-27-2006, 03:42 AM   #10
Roxxor2
LQ Newbie
 
Registered: Mar 2006
Posts: 23

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by muha
So, how can you tell whether the ssh daemon is running or not? (as root) try
Code:
rcsshd status
rcsshd is an unknown command.
 
Old 03-27-2006, 08:30 AM   #11
Wells
Member
 
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417

Rep: Reputation: 53
To see if there is an sshd process running on ANY linux machine, you could try the following:

$ ps -ef | grep ssh

That should show you whether or not there is either an ssh or sshd process running at any given time.
 
  


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
Ubuntu + avahi-daemon/tools Valhalla Linux - Software 0 12-10-2005 03:58 PM
SSH daemon under AIX5 NOTORIOUS VR AIX 13 03-11-2005 01:23 PM
ssh daemon colors? daryl314 Linux - Software 4 01-25-2005 11:13 AM
Configuration of SSH daemon on Slackware 9.1 - Newbie BenChase Slackware 7 12-14-2003 10:57 PM
Solaris 9 and SSH Daemon g_goblin Solaris / OpenSolaris 3 11-05-2003 01:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:21 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