"SSH: Can't connect to port 22, connection refused" - Remote Testing on a Test Board - Using Mounted Root Filesystem (NFS Boot) -

1,066 views
Skip to first unread message

Sunil Nagpal

unread,
Feb 4, 2011, 1:17:43 PM2/4/11
to Chromium OS dev
I have gotten NFS Boot working beautifully, and I am now trying to run
some tests from inside the chroot through the seaboard. When I try my
script to run the test, with the IP of the seaboard as the remote IP,
I get a message that the connection to Port 22 is refused (ssh). Sshd
is installed on the seaboard but not running and I feel this is the
problem. My server is running on the seaboard and my Ubuntu machine is
the host. Any idea on how to get that running so I can get my tests
running?

Richard Barnette

unread,
Feb 4, 2011, 2:17:08 PM2/4/11
to Sunil Nagpal, Chromium OS dev

By default, sshd on the target won't start unless you've built a
test image. If you don't know what kind of image you've built, it
isn't a test image. If you're trying to use 'run_remote_tests.sh',
a test image is a pre-requisite:
http://www.chromium.org/chromium-os/testing
http://www.chromium.org/chromium-os/testing/running-tests

If you just want a developer image with sshd running, you can
manually start sshd with this command:
sudo start openssh-server

Caveat: I tested on x86 hardware (a Cr-48). I can't vouch for
its success on ARM, although my expectation is that it works,
or that if you report it doesn't work, it will get attention.

Enjoy!


> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.or

-- jrb

Sunil Nagpal

unread,
Feb 7, 2011, 1:21:31 PM2/7/11
to Chromium OS dev
Hi,

Thanks for responding. I am indeed working with a test image that I've
built with the "--autotest" flag enabled throughout the build process.
I have realized that sshd is installed on the target but is not
started. I tried starting it by running "sudo ./openssh-server.conf"
from the /etc/init directory, but it tells me the command is not
found. Any suggestions on how to get it started would be greatly
appreciated.

Thanks,

Sunil
> > Chromium OS Developers mailing list: chromium-os-...@chromium.org

Simon Glass

unread,
Feb 7, 2011, 1:23:51 PM2/7/11
to Sunil Nagpal, Chromium OS dev
Hi,

Do you mean:

initctl restart openssh-server

Regards,
Simon

> Chromium OS Developers mailing list: chromiu...@chromium.org


> View archives, change email options, or unsubscribe:

> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

Sunil Nagpal

unread,
Feb 7, 2011, 1:33:52 PM2/7/11
to Chromium OS dev
My apologies, I meant "sudo ./openssh-server.conf start". That was the
command that I tried because another person in my team had that work
on a nightly (unmodified for NFS Boot) build and it worked. I will try
the command you suggest right now.
> >http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

Richard Barnette

unread,
Feb 7, 2011, 1:58:14 PM2/7/11
to Sunil Nagpal, Chromium OS dev
On Feb 7, 2011, at 10:33 AM, Sunil Nagpal wrote:

> My apologies, I meant "sudo ./openssh-server.conf start". That was the
> command that I tried because another person in my team had that work
> on a nightly (unmodified for NFS Boot) build and it worked. I will try
> the command you suggest right now.
>

Sunil,

The command to start sshd is as I reported it before:
sudo start openssh-server

The /etc/init/openssh-server.conf file is not an executable
script: It's an upstart job file. You need to use upstart
commands to get things going.

The command from Simon may not work if sshd isn't already
running.

Also, you mentioned that you built a test image by using --withautotest.
That option (for build_package) alone isn't enough (indeed, that option
is on by default anyway): To get a test image you must run
'mod_image_for_test.sh'. The instructions for this are on the web pages
I cited before:
http://www.chromium.org/chromium-os/testing/running-tests
http://www.chromium.org/chromium-os/testing

Thanks!

> Chromium OS Developers mailing list: chromiu...@chromium.org


> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

-- jrb

Sunil Nagpal

unread,
Feb 7, 2011, 2:08:55 PM2/7/11
to Chromium OS dev
Where is this command supposed to be/should I run it from?

Sunil Nagpal

unread,
Feb 7, 2011, 2:11:56 PM2/7/11
to Chromium OS dev
I have indeed run 'mod_image_for_test.sh' as well. I'll try your steps
and see where it takes me. Thanks.

Sunil Nagpal

unread,
Feb 7, 2011, 2:18:22 PM2/7/11
to Chromium OS dev
Ok, I've gotten that to start and now when I try
the .run_remote_test.sh command I get the following:

"Initiating first contact with remote host
ssh: connect to host 172.17.150.240 port 22: No route to host"

...this seems like a firewall/iptables config issue, correct?

Simon Glass

unread,
Feb 7, 2011, 2:24:25 PM2/7/11
to Sunil Nagpal, Chromium OS dev
Hi Sunil,

I don't think so, because mod_image_for_test changes iptables to enable ssh.

That error suggests that the IP address you are using is not the one
for your board, or it is not on the network. I suggest these steps:

1. 'ifconfig eth0' on the board serial console to make sure you have
the right IP address

2. 'ps ax |grep ssh' to make sure that the ssh server is running

3. Also try 'ssh localhost' on the board until you get it running.

4. If you cannot start the ssh server, please let us know.

Regards,
Simon

> Chromium OS Developers mailing list: chromiu...@chromium.org


> View archives, change email options, or unsubscribe:

> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

Richard Barnette

unread,
Feb 7, 2011, 2:37:57 PM2/7/11
to Sunil Nagpal, Chromium OS dev

On Feb 7, 2011, at 11:18 AM, Sunil Nagpal wrote:

> Ok, I've gotten that to start and now when I try
> the .run_remote_test.sh command I get the following:
>
> "Initiating first contact with remote host
> ssh: connect to host 172.17.150.240 port 22: No route to host"
>
> ...this seems like a firewall/iptables config issue, correct?
>

It does sound like something in your network infrastructure is
interfering with the connection.

Can you get to the target via ping?

Thanks!

> Chromium OS Developers mailing list: chromiu...@chromium.org


> View archives, change email options, or unsubscribe:

> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en

-- jrb

Sunil Nagpal

unread,
Feb 7, 2011, 3:55:44 PM2/7/11
to Chromium OS dev
Actually I've got it to work now, thanks for all your help!
> >http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>
> -- jrb
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages