#Struggling with ssh on my arch linux server

171 messages · Page 1 of 1 (latest)

novel hearth
#

I run a linux server myself, with its ssh working fine, after sometime (let's just say 1-2 days after its being turned on) it just says connection refused: no route to host
Temporary fix: to fix this I just restart the server and everythings back working good. But obviously looking for a permanent fix to prevent this from happening, all kind of help is welcome.

novel hearth
#

if anyone knows why this might be happening, it is welcome

#

maybe something to do with nmcli (network manager config)?

proven forum
novel hearth
#

Yeah

proven forum
#

How did you verify that

novel hearth
#

like

#

its at the same network

#

via lan

#

but

#

the issue might be cuz of the ip

proven forum
#

But is it actually still connected when ssh fails?

novel hearth
#

yeah, but for some reason it just breaks

#

i need to reboot for it to get fixed

proven forum
novel hearth
#

so then what could be the issue=

#

my router?

proven forum
novel hearth
#

the server itself u mean?

proven forum
novel hearth
proven forum
proven forum
novel hearth
#

cuz its outside of the server's internet network

novel hearth
#

i have port forwarding

#

im using a computer from another place

#

to ssh

proven forum
#

Are you sure the port is open

novel hearth
#

yeah pfc

#

ofc

proven forum
novel hearth
#

cuz i have a rpi4 with the same stuff (network connection and that on the same wifi network)

#

and it works perfectly fine

novel hearth
#

i don't really know that

#

maybe it has to do with router updates?

proven forum
novel hearth
#

idk

proven forum
novel hearth
#

ill try doing a fresh instal

proven forum
#

Are you able to access ssh from within the network when this issue occurs?

proven forum
novel hearth
#

you mean ssh to other devices when the thing is down?

proven forum
#

No, I mean, can you connect to your internal network with the ssh client machine and ssh into the server when your are unable to ssh from the internet?

novel hearth
#

nah because

#

the ip seems to change too

#

u mean locally right?

proven forum
#

Yes

novel hearth
#

the ip gets changed too

proven forum
#

That's your issue

novel hearth
#

idk why

#

the ip gets changed but when i reboot it gets back to normal

proven forum
novel hearth
#

nah

#

im using nmcli

#

nmcli con mod (attributes=

proven forum
#

Using DHCP or not

novel hearth
#

not using it

proven forum
#

You've manually set an IP and default gateway?

novel hearth
#

yeah

#

same stuff with the raspberry pi and it works without an issue

proven forum
#

What's the static IP set to, what is the IP changing to, and what is the IP when it boots?

novel hearth
#

192.168.1.15 --> static
192.168.1.135 --> when it changes
when it boots --> 192.168.1.15

#

but for a little period of time it says 0.0.0.0

#

but when i refresh the routers page it says 192.168.1.15

#

weird issue also is that the hostname isn't displaying

proven forum
#

Do you have another DHCP daemon running?

novel hearth
#

nope

#

seems to be the weirdest bug ever

#

do you know what could be causing this? @proven forum

proven forum
novel hearth
#

weird thing is that

#

i think dhcp is set to range for some ips range

#

but on the rpi

#

i've not set any dhcp

#

and it works well

#

how could i try a workaround this?

proven forum
novel hearth
#

maybe if i try fresh install?

#

maybe i fucked something that has to do with ip

#

or whatever

proven forum
novel hearth
#

nah since i just use it for mining and shit

novel hearth
#

What could be the issue @proven forum

proven forum
#

That's all I can say with the info we have

lament egret
novel hearth
#

Why

lament egret
#

Have you actually checked the server logs after that issue? SSH, Journalctl, can you ping from the server to your PC? Did you checked ip a or any logs from your DHCP client? (dhcpcd or dhclient (deprecated))

#

Which I dont think is going to change anything but it will make Network device names static

#

For example, if your network interface is enp1s0, after you connect a new PCI-E device and reboot the server, the new name of the interface could be enp2s0

#

Bit it's probably DHCP so check the logs of your installed DHCP client with journalctl

#

And also arp -a to check the ARP table when your PC cannot reach your server

#

Or viceversa

proven forum
#

It's basically required for a few realtek ones to work reliably

novel hearth
#

only restarting fixes it

#

which is too annoying cuz a server is meant to stay alive

#

and just physical access for updates/etc

#

i have my raspberry with the same config and its been 18 days up nwo

#

now

lament egret
#

@novel hearth but did you even tried to Search something about the internet in the logs?

#

You have local access to the machine, just connect it to a screen, put a keyboard and run sudo dmesg -w and sudo journalctl -f

#

At the same time, you can do that using tmux

#

(If you are only on a TTY)

novel hearth
#

this is everything

#

what could be the issue @lament egret

lament egret
#

Log?

novel hearth
#

im gonna go on linux and send it rq

#

Jun 05 19:53:53 forcaworks1 NetworkManager[453]: <info> [1717610033.1482] device (wlo1): supplicant interface state: inactive -> disconnected
Jun 05 19:53:53 forcaworks1 NetworkManager[453]: <info> [1717610033.1482] device (p2p-dev-wlo1): supplicant management interface state: inactive -> disconnected
Jun 05 19:53:53 forcaworks1 NetworkManager[453]: <info> [1717610033.1540] device (wlo1): supplicant interface state: disconnected -> inactive
Jun 05 19:53:53 forcaworks1 NetworkManager[453]: <info> [1717610033.1540] device (p2p-dev-wlo1): supplicant management interface state: disconnected -> inactive
Jun 05 19:59:07 forcaworks1 sshd[11801]: Accepted publickey for forcadeitor from 100.104.158.87 port 55680 ssh2: RSA SHA256:h+Pp3HMDbG5BTqGpG83zBeRStg+NSELNibimocYlK4g
Jun 05 19:59:07 forcaworks1 sshd[11801]: pam_unix(sshd:session): session opened for user forcadeitor(uid=1000) by forcadeitor(uid=0)
Jun 05 19:59:07 forcaworks1 systemd-logind[454]: New session 5 of user forcadeitor.
Jun 05 19:59:07 forcaworks1 systemd[1]: Started Session 5 of User forcadeitor.
Jun 05 20:00:38 forcaworks1 sudo[11811]: forcadeitor : TTY=pts/0 ; PWD=/home/forcadeitor ; USER=root ; COMMAND=/usr/bin/journalctl -f
Jun 05 20:00:38 forcaworks1 sudo[11811]: pam_unix(sudo:session): session opened for user root(uid=0) by forcadeitor(uid=1000)

#

@lament egret

novel hearth
#

that's all it appears

lament egret
#

You have the server on right now?

novel hearth
#

yeah

lament egret
#

Without internet access?

novel hearth
#

nope

#

i just restarted it

#

i have ssh access

#

@lament egret

lament egret
#

You just restarted it one time right?

novel hearth
#

yeah

lament egret
#

Then do sudo journalctl -b -1 --no-tail > file.txt and upload the file to https://pbin.nadeko.net

Select burn after reading and upload the file.txt using attach a file

#

You can transfer the file from your server to your PC using SCP or rsync

novel hearth
#

how to do that?

#

transfer file i mean+

lament egret
#

Using scp?

novel hearth
#

or what if i just cat the file

#

and copy paste it

lament egret
#

You can do that, but it will be a big large output

novel hearth
lament egret
#

@novel hearth is getting connected via wifi?

novel hearth
#

ethernet

#

why do you ask?

lament egret
#

becuase there is a lot of logs about the wifi device from network manager

#

if it's a server, why are you using network manager?

novel hearth
#

i use that on the raspberry too

lament egret
#

I suggest to uninstall network manager and only use dhcpcd

#

you don't need network manager on servers

#

Or any VPS provider would have network manager built-in on their linux ISOs

novel hearth
#

ok so

#

my idea is

#

i turned it on today

#

let's see how many days it takes for this to go off again

#

and we could see what to do

lament egret
#

The last restart was becaue you didn't have internet nor ssh access on the server right?

novel hearth
#

eys

#

yes

lament egret
#

I would suggest to uninstall network manager if this happens again then

#

and only use dhcpcd

#

because there a lot of weird logs from network manager with the wifi interface

novel hearth
#

ok

#

thanks so much

#

but+

#

if this happens again

#

and we need to use

#

dhcpcd

#

can you show me how to

#

because i never used thatç

lament egret
novel hearth
#

It's been 10 days without touching it and it's been working well

#

since today

#

so my guess is