Can no longer connect via ssh

Kernels & Hardware, configuring network, installing services

Can no longer connect via ssh

Postby TygerTung » 2020-08-03 20:59

Hi,

I installed Debian 9 onto an old HP Thin Client to use as a PiHole DNS server. I had to thin it out a bit as there is only a 1GB flash drive. I only installed ssh as an optional extra over the base system.

After getting the pi-hole up and running I can no longer log into the machine using ssl. It doesn't appear on the DHCP table, but maybe that is because I have given it a fixed IP address so that it works as a DNS server.

If I ping its IP address it responds.

When I try to log in this happens:
Code: Select all
sam@sam-1215P:~$ ssh 192.168.1.5
ssh: connect to host 192.168.1.5 port 22: Connection refused


It is preferable to be able to get into the machine remotely, so I don't need a monitor and keyboard hooked up at all times.

Cheers,

Sam
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: Can no longer connect via ssh

Postby RU55EL » 2020-08-03 21:11

What account are you trying to connect to?

Code: Select all
sam@sam-1215P:~$ ssh sam@192.168.1.5
User avatar
RU55EL
 
Posts: 474
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Can no longer connect via ssh

Postby TygerTung » 2020-08-03 21:25

Maybe sam? There is only one account there.
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: Can no longer connect via ssh

Postby eriefisher » 2020-08-03 21:30

What was the user name you set up on that system??? Also you don't need the port if your using the defaults but that's a whole other thing.
____________________________________________
There's a manual?
Siduction
Debian Sid
Xfce4 4.14
User avatar
eriefisher
 
Posts: 130
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: Can no longer connect via ssh

Postby TygerTung » 2020-08-03 21:31

It is the same username on both machines so previously connected OK.
Code: Select all
ssh sam@192.168.1.5

That returns the same result,
Code: Select all
ssh: connect to host 192.168.1.5 port 22: Connection refused
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: Can no longer connect via ssh

Postby eriefisher » 2020-08-03 21:44

"connection refused"

I the server running on that machine? Have you got the right machine?
____________________________________________
There's a manual?
Siduction
Debian Sid
Xfce4 4.14
User avatar
eriefisher
 
Posts: 130
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: Can no longer connect via ssh

Postby TygerTung » 2020-08-03 22:02

Yes, it is the correct machine. I fixed the IP address in the router to ensure it wouldn't change.
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: Can no longer connect via ssh

Postby sickpig » 2020-08-04 00:55

is sshd running?
Code: Select all
# systemctl status sshd
User avatar
sickpig
 
Posts: 474
Joined: 2019-01-23 10:34

Re: Can no longer connect via ssh

Postby TygerTung » 2020-08-04 01:03

I checked on both machines; same result:

Code: Select all
sam@sam-1215P:~$ systemctl status sshd
Unit sshd.service could not be found.
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: Can no longer connect via ssh

Postby sickpig » 2020-08-04 01:33

You kinda need sshd on your pihole to be able to ssh into it...
User avatar
sickpig
 
Posts: 474
Joined: 2019-01-23 10:34

Re: Can no longer connect via ssh

Postby cuckooflew » 2020-08-04 01:52

I only installed ssh as an optional extra over the base system.


I am pretty sure openssh-server also needs to be installed.
Code: Select all
# apt install openssh-server

If that still does not work try :
Code: Select all
apt-get purge openssh-server
 apt-get install openssh-server

There is some more trouble shooting tips here: https://www.ssh.com/ssh/sshd/
========= edit =====
And some minimal search foo will get even more information,
EG: key words:
Code: Select all
installed ssh on Debian, but it says Unit sshd.service could not be found.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Can no longer connect via ssh

Postby sickpig » 2020-08-04 02:12

@OP you might want to consider Dropbear as an alternative to open-ssh if you are storage space challenged.
User avatar
sickpig
 
Posts: 474
Joined: 2019-01-23 10:34

Re: Can no longer connect via ssh

Postby cuckooflew » 2020-08-04 02:30

Also the Debian documentation is very usefull:
https://wiki.debian.org/SSH
Installation of the server

The server allows to connect remotely and gets installed by running as root:
Code: Select all
apt install openssh-server


I see it mentions "DropBear " as well. as a alternative.

TygerTung » I had to thin it out a bit as there is only a 1GB flash drive. I only installed ssh as an optional extra over the base system.

Rather then struggling and fretting because there is only 1gb available, maybe consider buying another flash drive, but with 10gb, or even 20gb, or more , 32 gb ?
I see some for as low as $5.00, but I guess that depends on what part of the world you are in as well,...
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Can no longer connect via ssh

Postby TygerTung » 2020-08-04 06:05

It is really surprising that I need to install another package, as yesterday just normal "ssh" was working fine, but today no good?!

I'll try again tomorow.
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: Can no longer connect via ssh

Postby sickpig » 2020-08-04 06:11

could have gotten removed during
TygerTung wrote:I had to thin it out a bit as there is only a 1GB flash drive. I only installed ssh as an optional extra over the base system.

you can check the dpkg logs to ascertain
User avatar
sickpig
 
Posts: 474
Joined: 2019-01-23 10:34

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable