Failing to log into my ssh server (first time using ssh)

Greetings all.

This is my first post asking about a technical matter so I apologise if it’s not in the right place or if I don’t give all the needed technical information… I will learn.

I have an old Pavillion slimline I’m wanting to set up as a web and email server. I’ve been trying to follow the guides on the wiki here and a few guides I’ve found

I have endevourOS on the server and the client PC im curently on now which is my daily driver.

I had to install openssh on this client machine as it didnt seem to be installed by default but it reports it is installed and running now when I use sytemctl.

When I try to login to the server the comand prompt just goes to a new line with the white cursor flashing and nothing more. The system seems to hang after awhile and then shortly after that the terminal prompt closes and everything is normal again but I’m no further forward.

I’m happy to provide logs or error messages but havent done so here as I’m not sure what would be useful.

Thanks in advance

Are the machines running firewalls, are the ports open? I personally do not perceive the need for a firewall, but it was introduced a few months ago.

They are both running firewalls as far as I can tell and I did try to run the commands in the EOS wiki guide to make them let port 22 work right. I have heard a lot about not needing a firewall but I’ve no idea how to get rid of it if that is the right thing to do

have you enabled and started the sshd service?
sshd service needs to be started on the system which you want to ssh into

sudo systemctl enable --now sshd

yes I did that. Got and active response and confirmation when I ran sudo systemctl status sshd

On both client and remote machines

can you try post the command and output when you try to ssh into the system?

Also you can look at the sshd journal after you try ssh onto it.

journalctl -u sshd

Initial I typed: ssh draylath@129.168.0.126

After a few minuets of hanging and being locked out of terminal I got a prompt back and ran the journal command. It gave me this:

Dec 30 08:39:33 Zen systemd[1]: Started OpenSSH Daemon.
Dec 30 08:39:33 Zen sshd[429]: Server listening on 0.0.0.0 port 22.
Dec 30 08:39:33 Zen sshd[429]: Server listening on :: port 22.
Dec 30 09:29:07 Zen sshd[429]: Received signal 15; terminating.
Dec 30 09:29:07 Zen systemd[1]: Stopping OpenSSH Daemon…
Dec 30 09:29:07 Zen systemd[1]: sshd.service: Deactivated successfully.
Dec 30 09:29:07 Zen systemd[1]: Stopped OpenSSH Daemon.
– Boot 6bf222d5e3a24050afce9841b25acc40 –
Dec 30 17:45:02 Zen systemd[1]: Started OpenSSH Daemon.
Dec 30 17:45:02 Zen sshd[438]: Server listening on 0.0.0.0 port 22.
Dec 30 17:45:02 Zen sshd[438]: Server listening on :: port 22.
Dec 30 22:15:17 Zen systemd[1]: Stopping OpenSSH Daemon…
Dec 30 22:15:17 Zen sshd[438]: Received signal 15; terminating.
Dec 30 22:15:17 Zen systemd[1]: sshd.service: Deactivated successfully.
Dec 30 22:15:17 Zen systemd[1]: Stopped OpenSSH Daemon.
– Boot 108aa0d1b7a74c229f0283575d9275c8 –
Dec 31 14:40:40 Zen systemd[1]: Started OpenSSH Daemon.
Dec 31 14:40:40 Zen sshd[422]: Server listening on 0.0.0.0 port 22.
Dec 31 14:40:40 Zen sshd[422]: Server listening on :: port 22.
Dec 31 15:39:20 Zen systemd[1]: Stopping OpenSSH Daemon…
Dec 31 15:39:20 Zen sshd[422]: Received signal 15; terminating.
Dec 31 15:39:20 Zen systemd[1]: sshd.service: Deactivated successfully.
Dec 31 15:39:20 Zen systemd[1]: Stopped OpenSSH Daemon.
– Boot 6419e086ce204e5eb51362ed39fd2543 –
Dec 31 16:57:22 Zen systemd[1]: Started OpenSSH Daemon.
Dec 31 16:57:22 Zen sshd[395]: Server listening on 0.0.0.0 port 22.
Dec 31 16:57:22 Zen sshd[395]: Server listening on :: port 22.
Dec 31 17:14:47 Zen systemd[1]: Stopping OpenSSH Daemon…
Dec 31 17:14:47 Zen sshd[395]: Received signal 15; terminating.
Dec 31 17:14:47 Zen systemd[1]: sshd.service: Deactivated successfully.
Dec 31 17:14:47 Zen systemd[1]: Stopped OpenSSH Daemon.
– Boot 937f60a43d6841ff995b10df365bf3e5 –
Dec 31 17:15:17 Zen systemd[1]: Started OpenSSH Daemon.
Dec 31 17:15:17 Zen sshd[414]: Server listening on 0.0.0.0 port 22.
Dec 31 17:15:17 Zen sshd[414]: Server listening on :: port 22.
Dec 31 19:55:20 Zen sshd[414]: Received signal 15; terminating.
Dec 31 19:55:20 Zen systemd[1]: Stopping OpenSSH Daemon…
Dec 31 19:55:20 Zen systemd[1]: sshd.service: Deactivated successfully.
Dec 31 19:55:20 Zen systemd[1]: Stopped OpenSSH Daemon.
– Boot def0757a7a2340bd953ede90e282c03e –
Dec 31 20:31:30 Zen systemd[1]: Started OpenSSH Daemon.
Dec 31 20:31:30 Zen sshd[378]: Server listening on 0.0.0.0 port 22.
Dec 31 20:31:30 Zen sshd[378]: Server listening on :: port 22.

the ssh command the journaltl command have to be run on different systems.

journaltclt command has to be run on the system with ssh daemon or sshd running i.e. the server.

ssh command has to be run on the system from which you want to ssh to the server i.e. the client.

Can you show the output of ssh command with the command itself??

ssh draylath@129.168.0.126 -vv

After you run the ssh command, then run the journalctl command on the server.

Also try to format your output like this to make it readable
```
output here
```

Ah I didn’t know that sorry.

Unfortunatly not. As soon as I make any attempt to run the ssh on the client computer it partially locks up and I get a single flashing cursor only. No output and the system starts to hang.

[draylath@Orac ~]$ journalctl -u sshd
Dec 29 11:12:47 Orac systemd[1]: Started OpenSSH Daemon.
Dec 29 11:12:47 Orac sshd[2723]: Server listening on 0.0.0.0 port 22.
Dec 29 11:12:47 Orac sshd[2723]: Server listening on :: port 22.
Dec 29 11:23:31 Orac sshd[2723]: Received signal 15; terminating.
Dec 29 11:23:31 Orac systemd[1]: Stopping OpenSSH Daemon...
Dec 29 11:23:31 Orac systemd[1]: sshd.service: Deactivated successfully.
Dec 29 11:23:31 Orac systemd[1]: Stopped OpenSSH Daemon.
-- Boot 7556622240344549a367ebc21e779cd2 --
Dec 29 13:38:32 Orac systemd[1]: Started OpenSSH Daemon.
Dec 29 13:38:33 Orac sshd[405]: Server listening on 0.0.0.0 port 22.
Dec 29 13:38:33 Orac sshd[405]: Server listening on :: port 22.
Dec 29 13:49:18 Orac systemd[1]: Stopping OpenSSH Daemon...
Dec 29 13:49:18 Orac sshd[405]: Received signal 15; terminating.
Dec 29 13:49:18 Orac systemd[1]: sshd.service: Deactivated successfully.
Dec 29 13:49:18 Orac systemd[1]: Stopped OpenSSH Daemon.
-- Boot d643199c72e94a11921dd74bed41df0a --
Dec 29 14:19:01 Orac systemd[1]: Started OpenSSH Daemon.
Dec 29 14:19:02 Orac sshd[401]: Server listening on 0.0.0.0 port 22.
Dec 29 14:19:02 Orac sshd[401]: Server listening on :: port 22.
Dec 29 14:35:43 Orac systemd[1]: Stopping OpenSSH Daemon...
Dec 29 14:35:43 Orac systemd[1]: sshd.service: Deactivated successfully.
Dec 29 14:35:43 Orac systemd[1]: Stopped OpenSSH Daemon.
-- Boot 41c824f8d98d47a7b64e1c2775497774 --

I just worked out how to put in code. Apologies for before I didn’t know about that either

This is really strange. Can you try updating your computer, restarting and then use another terminal emulator

I always update both systems as soon as I get a notification from the EOS tool so both systems are bang up to date.

I did try to use ssh to log in to the server again and I used the command you sent me. It gave some output that might help but the lock ups prevented me from copying it.

It said it was looking in the /etc/ssh/sshd-config file so I’m thinking there might be a problem with how that is set up maybe?

This won’t matter, since the problem is on your client and not the server.
sshd config only effects the server.

Have you tried another terminal emulator??

Do you have an Android phone? (don’t know anything about iOS :smiley: ), try and ssh in from your phone to your server. I use JuiceSSH, but there are loads available.

Just shooting from the hip here, but would it help to clear the ssh credential cache on the client-side machine?

Please show the content of the following file

cat /etc/hosts

also the output of this command

ip route

Is 129.168.0.126 a static IP address on the server?

On the client machine, can you ping 127.0.0.1 (127.0.0.1 is the Iocal-loopback )

On the client machine, can you ping 129.168.0.126

Also what kernel are you running on?

Pudge

1 Like

Tried that and it failed, but good to know I’ll have the option to access this on my phone if I ever get it working lol.

# Standard host addresses
127.0.0.1  localhost
::1        localhost ip6-localhost ip6-loopback
ff02::1    ip6-allnodes
ff02::2    ip6-allrouters
# This host address
127.0.1.1  Zen
129.168.0.126  Orac.localdomain
Orac
default via 192.168.0.1 dev wlan0 proto dhcp src 192.168.0.214 metric 600 
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.214 metric 600 

As far as I could tell, I got it from a command on the guide from the wiki here to identify the server IP

This was a total success

This was a total failure. 100% package loss

Both machines are running 6.1.1-arch1-1

In your /etc/hosts file, the following should be on one line

129.168.0.126{Tab}Orac.localdomain{Tab}Orac

I don’t know if what you have on what appears to be two lines is problematic, but this is how it is supposed to be.

next step, run nmap and see if your server is available. nmap will probably not be installed by default, so if necessary install nmap. I assume 129.168.0.1 is the LAN side IP address of your router. Here is my nmap with some entries deleted for brevity.

$ sudo nmap 192.168.0.0/24
 
Starting Nmap 7.93 ( https://nmap.org ) at 2022-12-31 16:56 MST
Nmap scan report for 192.168.0.1
Host is up (0.0023s latency).
Not shown: 998 closed tcp ports (reset)
PORT     STATE SERVICE
80/tcp   open  http
1900/tcp open  upnp
MAC Address: 84:16:F9:87:2F:1A (Tp-link Technologies)

Nmap scan report for 192.168.0.101
Host is up (0.00037s latency).
Not shown: 999 closed tcp ports (reset)
PORT     STATE SERVICE
7000/tcp open  afs3-fileserver
MAC Address: C8:3A:6B:18:99:FB (Roku)

SNIP

Nmap scan report for enosServer.localdomain (192.168.0.163)
Host is up (0.00044s latency).
Not shown: 997 filtered tcp ports (no-response)
PORT     STATE SERVICE
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
8200/tcp open  trivnet1
MAC Address: 00:1E:06:37:95:C6 (Wibrain)

The first entry is info for my Router which is a TP-link

The second entry is for my Roku

The last entry is for my server running on an Odroid XU4 ARM device (Wibrain)

You should see similar results for your server at 129.168.0.0/24

Pudge

Ok, the first issue with the 2 lines thing I fixed.

I installed nmap and I got the following… likewise some entries omitted for brevity:

Nmap scan report for SkyRouter.Home (192.168.0.1)
Host is up (0.0027s latency).
Not shown: 992 closed tcp ports (reset)
PORT      STATE    SERVICE
53/tcp    open     domain
80/tcp    open     http
4444/tcp  open     krb524
4567/tcp  open     tram
5060/tcp  filtered sip
5431/tcp  open     park-agent
31337/tcp open     Elite
49163/tcp open     unknown
MAC Address: 80:72:15:45:E7:91 (SKY UK Limited)



Nmap scan report for Orac (192.168.0.126)
Host is up (0.10s latency).
Not shown: 840 filtered tcp ports (no-response), 159 filtered tcp ports (admin-prohibited)
PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: 00:17:3F:AF:30:7D (Belkin International)

Nmap scan report for Orac (192.168.0.126)
Host is up (0.10s latency).
Not shown: 840 filtered tcp ports (no-response), 159 filtered tcp ports (admin-prohibited)
PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: 00:17:3F:AF:30:7D (Belkin International)

One other thing. If I try to login using ssh and I add the port number 22 I get this message:

[draylath@Zen ~]$ ssh admin@192.168.0.126:22
Bad stdio forwarding specification '192.168.0.126:22:22'
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535