This is my first time using a pi, and first time using ssh, so please be patient and clear. Thanks for the help!

I am trying to run my pi headless, using my laptop's monitor and keybaord. I already have Raspian installed on a mini sd card, which is in the pi. The pi is powered on and connected via ethernet cable to my wireless router. I logged into the router and discovered the pi (which is labeled "recovery" for some reason) and its IP address.

I installed openssh-server on the laptop with which I'd like to control the pi, which currently runs Ubuntu 15.04:

sudo apt-get install openssh-server

I ran a few other commands I'd found related to using ssh for the purpose of pi:

systemctl enable sshd.service
systemctl start sshd.service

matt:~$ systemctl status sshd.service
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2017-02-12 16:11:38 EST; 1min 27s ago
 Main PID: 9424 (sshd)
   CGroup: /system.slice/ssh.service
           └─9424 /usr/sbin/sshd -D

Feb 12 16:11:38 <MY COMPUTER> systemd[1]: Started OpenBSD Secure Shell server.
Feb 12 16:11:38 <MY COMPUTER> systemd[1]: Starting OpenBSD Secure Shell server...
Feb 12 16:11:38 <MY COMPUTER> sshd[9424]: Server listening on port 22.
Feb 12 16:11:38 <MY COMPUTER> sshd[9424]: Server listening on :: port 22.

However when I try to open the pi using ssh, I get this:

matt:~$ ssh pi@<PI IP from router>
ssh: connect to host port 22: Connection refused

When using SSH, the server is the device you're SSHing into - in this case the Raspberry Pi.

Installing the server on your laptop is not the fix here, instead you need to enable SSH on your Raspberry Pi (official RPi Guide) as this already has the server installed upon it. https://www.raspberrypi.org/documentation/remote-access/ssh/

Then your SSH x.x.x.x from the laptop will work - assuming Firewalls are off for example.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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