TurnKey Linux Virtual Appliance Library

SSH Connection Refused on LAMP appliance

Newbie question. I just brough up a vanilla local instance of the LAMP appliance. I'm able to login to webmin, and was also able to setup an VSFTPD by using Shell in a Box. I've not touched the SSH configuration. From my desktop Ubuntu install I tried to connect via SSH by issuing the following from the command line:

ssh root@

It returns:

ssh: connect to host port 22: Connection refused

This is setup up on a local network.

Any help is appreciated.

Jeremy's picture


I assume that you ran through the firstboot scripts and set your root password etc. I use Bodhi Linux on my netbook (which is based on Ubuntu 10.04) and I haven't ever had issues with SSH connections working OOTB. Hard to say what might be going on...

Can you log in ok locally? Assuming you can, have a look what the SSH service is doing:

service ssh status

Assuming that is running (if not try 'start' instead of 'status') then check it is listening:

netstat -l |grep ssh

it should return something like this:

tcp        0      0 *:ssh                   *:*                     LISTEN     
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN     

At least that's what the TKL server (Core) that I just checked returns... If things all seem ok from that angle, then maybe try rebooting and to be sure, double check the appliance IP (ifconfig).

TBH though unless you can pin the issue down to something external (networking/firewall/etc) I'd be a little concerned that it doesn't work OOTB (as it should) and would encourage you to check the integrity of the image you downloaded (have a read here).

Out of interest by stopping the SSH service I could recreate the "connection refused" message.

BTW SFTP is available by default OOTB (although I'm guessing it won't work in your instance seeing as SSH isn't working...)

works locally, not over the web

I am able to login over the local network, but connections over the web with port 22 forwarded to the server from the router are refused.  What am I missing?

Jeremy's picture

I have no idea sorry

I have port 22 forwarded on my home router to a TKL instance and it works fine... So I can only conclude that there is an issue somewhere in your network config. AFAIK OOTB SSH should be configured to connect to anyone/anything so not at all sure what's going on...

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)