12

I tried to use SSH to reach my Pi 3

ssh pi@192.168.100.3 

but I get this message ssh: connect to host 192.168.100.3 port 22: Connection refused I install and install SSH but nothing has worked I tried to run

sudo ufw status verbose

but the output was :

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22                         ALLOW IN    Anywhere                  
22 (v6)                    ALLOW IN    Anywhere (v6)     

EDITED :

I tested the SSH status and it was active

sudo service ssh status

the output :

ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
   Active: active (running) since Wed 2016-09-07 05:01:47 AST; 7h ago
  Process: 16337 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCE
 Main PID: 15478 (sshd)
   CGroup: /system.slice/ssh.service
           └─15478 /usr/sbin/sshd -D

Plz help

** I am using Ubuntu 16.04

test me
  • 125
  • 1
  • 1
  • 6

5 Answers5

20

Make sure you have enabled SSH on your Raspberry Pi:

pi@raspberrypi$ sudo raspi-config 
>> Interface Settings 
>> SSH 
>> ENABLE

I think that will solve your problem.

Jacobm001
  • 11,904
  • 7
  • 47
  • 58
RPi-Coder
  • 201
  • 2
  • 3
7

I have headless raspberry pi. This is what I did to enable SSH.

Remove the memory and put it to reader. On your boot drive (raspberry memory card) make a file named "ssh" without file extension name.

Alternative way on macos is to cd to the raspberry pi boot volume. Then type touch ssh

then put the memory card back to raspberry pi. connect the r-pi to network.

ssh on terminal using ssh pi@raspberrypi.local

r_19
  • 171
  • 1
  • 1
2

I had a similar issue and I found an easy solution.

You may need to check your /etc/ssh/sshd_config file in order to allow connection. Check the PasswordAuthentication then type sudo service ssh restart in a terminal. You should be able to connect through ssh now.

Aurora0001
  • 6,357
  • 3
  • 25
  • 39
1

Ubuntu or Ubuntu Mate does not come with a SSH server installed by default. Do you have installed it?

Try apt-get install openssh-server.

In other case, I would recommend to do a local connection to the raspberry. From a console inside your raspberry execute:

ssh localhost

You will skip on this way any firewall issue.

King Midas
  • 208
  • 1
  • 3
  • 14
1

There can be couple of simple reasons why you are not able to connect. But before all these steps make sure you are able to ping the machine without fallback / packet loss.

  1. check if ps -ef|grep "ssh"|grep -v grep . This should yield you the sshd daemon if its up. You can also check the status using systemctl/services sudo service ssh status

  2. Clear your keys from /home//.ssh/authorized_keys. Clear the entry which pertains to the previous raspberry connect. Sometimes its likely that the fingerprint (you would have seen [yes/No] option when you connect first time to a server or a linux pc over ssh) might be corrupted which is not allowing you to connect.

  3. You can look at other possibilities like firewall once you confirm the above steps.

Varad A G
  • 850
  • 6
  • 18