Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Can no longer connect via ssh

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
TygerTung
Posts: 27
Joined: 2020-08-03 17:00

Can no longer connect via ssh

#1 Post by TygerTung »

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

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Can no longer connect via ssh

#2 Post by RU55EL »

What account are you trying to connect to?

Code: Select all

sam@sam-1215P:~$ ssh sam@192.168.1.5

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

Re: Can no longer connect via ssh

#3 Post by TygerTung »

Maybe sam? There is only one account there.

User avatar
eriefisher
Posts: 130
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: Can no longer connect via ssh

#4 Post by eriefisher »

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

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

Re: Can no longer connect via ssh

#5 Post by TygerTung »

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

User avatar
eriefisher
Posts: 130
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: Can no longer connect via ssh

#6 Post by eriefisher »

"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

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

Re: Can no longer connect via ssh

#7 Post by TygerTung »

Yes, it is the correct machine. I fixed the IP address in the router to ensure it wouldn't change.

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Can no longer connect via ssh

#8 Post by sickpig »

is sshd running?

Code: Select all

# systemctl status sshd

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

Re: Can no longer connect via ssh

#9 Post by TygerTung »

I checked on both machines; same result:

Code: Select all

sam@sam-1215P:~$ systemctl status sshd
Unit sshd.service could not be found.

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Can no longer connect via ssh

#10 Post by sickpig »

You kinda need sshd on your pihole to be able to ssh into it...

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Can no longer connect via ssh

#11 Post by cuckooflew »

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!

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Can no longer connect via ssh

#12 Post by sickpig »

@OP you might want to consider Dropbear as an alternative to open-ssh if you are storage space challenged.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Can no longer connect via ssh

#13 Post by cuckooflew »

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!

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

Re: Can no longer connect via ssh

#14 Post by TygerTung »

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.

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Can no longer connect via ssh

#15 Post by sickpig »

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

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Can no longer connect via ssh

#16 Post by cuckooflew »

Code: Select all

sam@sam-1215P:~$ systemctl status sshd
Unit sshd.service could not be found. 
Well, this pretty much speaks for itself, Also this: http://forums.debian.net/viewtopic.php?f=30&t=146981 From the other topic you started, you show this:

Code: Select all

openssh-client install
[b]openssh-server deinstall[/b]
openssl install 
in your list. You know "deinstall", means remove ? It is simple, easy, to just check and see if it: (openssh-server ) is installed.

Code: Select all

dpkg --list | grep ssh 
If it does not show in the list, you need to install it, if it is in the list, you need to look at some other things, check to see if it even is installed first.
I'll try again tomorow.
Unless you change something between.today and tomorrow, it will be the same tomorrow as it is today, EG: install openssh-server today, and it will work again tomorrow.
If everything you need won't fit on a 1gb, flash stick, then you simply need to get a bigger one. Remove other things, will just succeed in breaking something else, eg; foo package , but foo package includes dependencies that foo2 package needs, you need to have enough drive space for all of the essential programs/packages. + some extra.. Even a Minix3 server needs at least 1.2gb to be functional, Debian is going to need more space, even if it is just the base (minimal install)
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: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Can no longer connect via ssh

#17 Post by cuckooflew »

Here is what a working ssh server looks like , using the commands posted in the previous posts:

Code: Select all

cuckoo@debian:~$ systemctl status sshd
* ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-08-04 09:03:04 CDT; 5h 9min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 412 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 425 (sshd)
    Tasks: 1 (limit: 1141)
   Memory: 2.4M
   CGroup: /system.slice/ssh.service
           `-425 /usr/sbin/sshd -D 
======================

Code: Select all

cuckoo@debian:~$dpkg --list | grep ssh 
ii  libssh-gcrypt-4:amd64                0.8.7-1+deb10u1                     amd64        tiny C SSH library (gcrypt flavor)
ii  libssh2-1:amd64                      1.8.0-2.1                           amd64        SSH2 client-side library
ii  openssh-client                       1:7.9p1-10+deb10u2                  amd64        secure shell (SSH) client, for secure access to remote machines
ii  openssh-server                       1:7.9p1-10+deb10u2                  amd64        secure shell (SSH) server, for secure access from remote machines
ii  openssh-sftp-server                  1:7.9p1-10+deb10u2                  amd64        secure shell (SSH) sftp server module, for SFTP access from remote machines
ii  task-ssh-server                      3.53                                all          SSH server

 
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!

debianneedstuning
Posts: 214
Joined: 2012-12-03 02:44

Re: Can no longer connect via ssh

#18 Post by debianneedstuning »

FWIW; When I recently had this problem after a version upgrade on a headless server, I was unable to fault find and in the end I apt-get remove'd openssh and openssh-server and reinstalled them. Just my 2c.

Post Reply