Page 1 of 1

Network Error: Connection Refused

Posted: Sat Jan 07, 2017 3:11 pm
by Manu MJ
Hi,

I recently bought Raspberry Pi 3 but I am unable to login I am getting an error as 'network error: connection refused'. I searched before posting it here but still could not fix the issue. I am trying log-in Raspberry Pi using my windows 7 laptop since I do not have a display and keyboard.

I am following the video to login Rpi: http://www.circuitbasics.com/raspberry- ... less-mode/

I did following:
1) Burnt raspbian image to SD card and inserted to Rpi
2) Connected Ethernet cable to internet router (I am able see green led blinking)
3) Used advanced scanner to find Rpi IP to perform SSH using Putty
4) Putty gives error 'network error connection refused'

I tried following troubleshooting:
1) Re-verified Rpi Ip using Kitty tool as well and it is same
2) Used my other windows 7 PC, still same error
3) Turned off windows fire-wall
4) Restarted my router

Please suggest what else need to check, to resolve this issue.

Thanks
Manu

Re: Network Error: Connection Refused

Posted: Sat Jan 07, 2017 5:21 pm
by FTrevorGowen
Have you fallen foul of this change?:
https://www.raspberrypi.org/blog/a-secu ... ian-pixel/
(ie. did you enable the SSH server etc. as per that blog?)
Trev.

Re: Network Error: Connection Refused

Posted: Sun Jan 08, 2017 10:27 am
by MattHawkinsUK
As Trev has pointed out it is because SSH is disabled by default in the newer Raspbian images.

Create a blank text file called "ssh" on the root of the SD card using your laptop. Then boot the Pi from it. That will enable SSH.

Re: Network Error: Connection Refused

Posted: Tue Feb 07, 2017 4:48 am
by wreeve
Placing the ssh file worked for me with Jessie Lite. Be sure the ssh file has no extension.

Re: Network Error: Connection Refused

Posted: Mon Feb 20, 2017 4:04 pm
by Nagaraj
Hello,

Even i am getting the network saying connection refused while trying to connect to raspberry pi via putty and ssh form laptop. i have tried all the methods and i am failed, the above method also i followed but dint work.

I suspect that windows firewall is preventing the SSH connections. Please help me with this problem, i am trying to debug this issue from past one month and failing every time.

Thanks in advance,
Nagaraj

Re: Network Error: Connection Refused

Posted: Mon May 15, 2017 3:50 pm
by Munneh
Hi Nagaraj!

Did u find fix your problem? I think I have the same problem after I updated Windows :(

Re: Network Error: Connection Refused

Posted: Sat Nov 18, 2017 5:41 pm
by in3vrr
RPI3 Raspbian GNU/Linux 8 (jessie)Linux 4.9.50-v7+ #1035 SMP with RSA KEY

After sudo apt-get update && sudo apt-get dist-upgrade I configured OpenVPN (with www.vpn.io) .... everything worked with new fiber router ... also worked (installed 6 months ago) SSH with RSA KEY.
Then I installed a Fritz! Box 7490 as a cascaded router on fiber modem (192.168.1.1) and strangely RPi kept IP assigned by the fiber modem even if the Fritz! 7490 LAN works on a separate network (192.168.178.1).
I solved this problem by setting static IP on Rpi
with sudo nano /etc/dhcpcd.conf
At the bottom of the file I entered:
nohook lookup-hostname
nodhcp
interface eth0
static ip_address=192.168.178.32/24
static routers=192.168.178.1
static domain_name_servers=192.168.178.1

Now the RPI can also be reached with PING in LAN but SSH does not even work in Lan (and not even in wan).
# SSH enabled, SSH port enabled
# RSA KEY the usual installed 6 months ago (with fiber router worked)
# Rpi reachable with ping in lan

PROBLEM - with sudo systemctl status ssh.service
i see:
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
Active: failed (Result: start-limit) since sab 2017-11-18 16:59:38 CET; 38min ago
Process: 1046 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
Main PID: 1046 (code=exited, status=255)

nov 18 16:59:38 RPi3 systemd[1]: Unit ssh.service entered failed state.
nov 18 16:59:38 RPi3 systemd[1]: ssh.service holdoff time over, scheduli...t.
nov 18 16:59:38 RPi3 systemd[1]: Stopping OpenBSD Secure Shell server...
nov 18 16:59:38 RPi3 systemd[1]: Starting OpenBSD Secure Shell server...
nov 18 16:59:38 RPi3 systemd[1]: ssh.service start request repeated too ...t.
nov 18 16:59:38 RPi3 systemd[1]: Failed to start OpenBSD Secure Shell server.
nov 18 16:59:38 BZ-RPi3 systemd[1]: Unit ssh.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

Can I go back and restore the old configuration? befor sudo apt-get update && sudo apt-get dist-upgrade ????
How ???
Thank you
Bob

Re: Network Error: Connection Refused

Posted: Sat Nov 18, 2017 6:04 pm
by in3vrr
I also tried with these commands but nothing changed:
sudo service ssh restart

sudo rm /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server

With sudo sshd -T i see:
/etc/ssh/sshd_config: line 93: Bad configuration option: AuthorizedKeysFiles
/etc/ssh/sshd_config: terminating, 1 bad configuration options

Line 93 is this: AuthorizedKeysFiles .ssh/authorized_keys
the file exists

:roll:

Re: Network Error: Connection Refused

Posted: Sat Nov 18, 2017 6:27 pm
by DirkS
in3vrr wrote:
Sat Nov 18, 2017 6:04 pm
Line 93 is this: AuthorizedKeysFiles .ssh/authorized_keys
the file exists
It's AuthorizedKeyFile (minus the s)
The default is

Code: Select all

#AuthorizedKeysFile	%h/.ssh/authorized_keys
As you can see it's actually commented out

Re: Network Error: Connection Refused

Posted: Sat Nov 18, 2017 7:09 pm
by in3vrr
DirkS wrote:
Sat Nov 18, 2017 6:27 pm
...cut
It's AuthorizedKeyFile (minus the s)
The default is

Code: Select all

#AuthorizedKeysFile	%h/.ssh/authorized_keys
Whouuu thanks a lot ...
I became crazy for a "s"
I'm SSSStupid
Thank you
Have a nice Sunday
Bob

Re: Network Error: Connection Refused

Posted: Wed Mar 14, 2018 1:20 pm
by gsn
MattHawkinsUK wrote:
Sun Jan 08, 2017 10:27 am
As Trev has pointed out it is because SSH is disabled by default in the newer Raspbian images.

Create a blank text file called "ssh" on the root of the SD card using your laptop. Then boot the Pi from it. That will enable SSH.



I faced the same issue. but this will made it working

Re: Network Error: Connection Refused

Posted: Sun Mar 31, 2019 4:10 am
by fiazmr
After creating the blank ssh file, and inserting it into my pi that was already connected it didn't work. Re-powering the supply and bootup it started working.