Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Crux Linux I already have installed SSH but when I use ssh-keygen, and try to use the command:

ssh localhost

to test SSH I get this error:

# ssh localhost
ssh: connect to host localhost port 22: Connection refused

So I decided to reinstall openssh but without apt-get I don't know how to do that.

share|improve this question
Apparently, Crux uses pkgutils as its package manager fukt.bsnet.se/~per/pkgutils However, I doubt that your problem is related to reinstalling openssh – jasonwryan Nov 12 '11 at 4:47
Is your sshd running? – Kevin Nov 12 '11 at 6:43
but if i don't have the software in the local,how can i install it from the net?! – kaiwii ho Nov 14 '11 at 3:47
up vote 2 down vote accepted

You have the client (and, I believe, also the server) installed. But you're not running the server on your machine (it's not started by default on Crux).

Add sshd to the SERVICES setting in /etc/rc.conf. See the handbook. This will take care of starting the SSH server at boot time. For now, run /etc/rc.d/sshd start.

As per the FAQ, you may want to customize /etc/hosts.allow or /etc/hosts.deny first. Note that these files offer hostname-based protection, which is not always trivial to circumvent but far from absolute nonetheless. Ssh itself provides good protection against intruders (as long as you don't enable passwords, or make sure every user has a high-entropy password), so I recommend allowing SSH access to all (sshd: ALL in /etc/hosts.allow).

share|improve this answer
thx,ur answer helps too much – kaiwii ho Nov 13 '11 at 9:55

Is your sshd running? ps aux | grep sshd. Is it running on the standard port? less /etc/ssh/sshd_config

share|improve this answer

You have to start the ssh daemon.

/etc/rc.d/sshd start

The location of the binary might be different, depending on how you installed it.

share|improve this answer
This is wrong. /etc/rc.d/sshd start – James Mills Jan 28 '15 at 0:26
@JamesMills: fixed, thanks – n0pe Jan 30 '15 at 23:08
@maxmackie The directory is still incorrect: rc.d, not init.d... – jasonwryan Jan 30 '15 at 23:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.