3

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.

3
  • 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, 2011 at 4:47
  • 5
    Is your sshd running?
    – Kevin
    Nov 12, 2011 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, 2011 at 3:47

3 Answers 3

3

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).

1
  • thx,ur answer helps too much
    – kaiwii ho
    Nov 13, 2011 at 9:55
1

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

0

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.

2
  • This is wrong. /etc/rc.d/sshd start Jan 28, 2015 at 0:26
  • @maxmackie The directory is still incorrect: rc.d, not init.d...
    – jasonwryan
    Jan 30, 2015 at 23:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .