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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-21-2006, 06:33 AM
|
#1
|
LQ Newbie
Registered: Mar 2006
Posts: 23
Rep:
|
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.
|
|
|
03-21-2006, 09:39 AM
|
#2
|
Member
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417
Rep:
|
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.
|
|
|
03-21-2006, 11:22 AM
|
#3
|
LQ Newbie
Registered: Mar 2006
Posts: 23
Original Poster
Rep:
|
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?
|
|
|
03-21-2006, 03:17 PM
|
#4
|
Member
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417
Rep:
|
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 ""
|
|
|
03-23-2006, 05:50 AM
|
#5
|
LQ Newbie
Registered: Mar 2006
Posts: 23
Original Poster
Rep:
|
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]
|
|
|
03-23-2006, 06:26 AM
|
#6
|
Member
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451
Rep:
|
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.
|
|
|
03-23-2006, 06:28 AM
|
#7
|
LQ Newbie
Registered: Mar 2006
Posts: 23
Original Poster
Rep:
|
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.
|
|
|
03-23-2006, 08:20 AM
|
#8
|
Member
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417
Rep:
|
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.
|
|
|
03-24-2006, 07:55 AM
|
#9
|
Member
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451
Rep:
|
So, how can you tell whether the ssh daemon is running or not? (as root) try
|
|
|
03-27-2006, 03:42 AM
|
#10
|
LQ Newbie
Registered: Mar 2006
Posts: 23
Original Poster
Rep:
|
Quote:
Originally Posted by muha
So, how can you tell whether the ssh daemon is running or not? (as root) try
|
rcsshd is an unknown command. 
|
|
|
03-27-2006, 08:30 AM
|
#11
|
Member
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 417
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 07:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|