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.
#Struggling with ssh on my arch linux server
171 messages · Page 1 of 1 (latest)
if anyone knows why this might be happening, it is welcome
maybe something to do with nmcli (network manager config)?
Is the server still connected to the network at the time?
Yeah
How did you verify that
But is it actually still connected when ssh fails?
No route to host usually means that either the host is offline or your own routing is messed up. The former is more common.
Your client machine
the server itself u mean?
Wdym
idk
No, your computer you're using to ssh into it.
Just was a wild guess?
na the computer caan't be the issue
cuz its outside of the server's internet network
Wdym
like
i have port forwarding
im using a computer from another place
to ssh
Are you sure the port is open
It's not scheduled to close at certian times or after inactivity?
cuz i have a rpi4 with the same stuff (network connection and that on the same wifi network)
and it works perfectly fine
um
i don't really know that
maybe it has to do with router updates?
I would assume that has a diffierent rule through?
idk
Unlikely
ill try doing a fresh instal
Are you able to access ssh from within the network when this issue occurs?
That probably isn't neccessary.
you mean ssh to other devices when the thing is down?
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?
Yes
the ip gets changed too
That's your issue
Are you using DHCP to get an IP on the server?
Using DHCP or not
not using it
You've manually set an IP and default gateway?
What's the static IP set to, what is the IP changing to, and what is the IP when it boots?
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
Do you have another DHCP daemon running?
nope
seems to be the weirdest bug ever
do you know what could be causing this? @proven forum
Something is breaking and causing the server to request an IP from DHCP, or something else is setting the IP. Try setting the IP for that device on your DHCP sever, which is probably your router.
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?
Not sure why this issue is specific to only one of your devices, just stating what I know
maybe if i try fresh install?
maybe i fucked something that has to do with ip
or whatever
I guess you can give it a try if it's not a massive hassle
nah since i just use it for mining and shit
What could be the issue @proven forum
.
That's all I can say with the info we have
Nah
Why
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))
You can also try applying this @novel hearth https://wiki.archlinux.org/title/Network_configuration#Revert_to_traditional_interface_names
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
It can help with some poorly made drivers
It's basically required for a few realtek ones to work reliably
cant ping or anything
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
@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)
ill try that
this is everything
what could be the issue @lament egret
What about the Journal lot?
Log?
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
That does not say anything
that's all it appears
You have the server on right now?
yeah
Without internet access?
You just restarted it one time right?
yeah
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
Using scp?
You can do that, but it will be a big large output
@novel hearth is getting connected via wifi?
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?
i use that on the raspberry too
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
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
The last restart was becaue you didn't have internet nor ssh access on the server right?
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
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ç
https://wiki.archlinux.org/title/dhcpcd @novel hearth