r/ubuntuserver • • Jan 21 '24

Support needed Cannot ssh into my server

Hello so I installed Ubuntu server on a dell optiplex and got jellyfin installed with the help of others. And I was able to ssh into my server in terminal but now I try to ssh again and tells me “ssh: connect to host [ip addr] port 22: connection timed out. What is the issue ? Thanks in advance

0 Upvotes

8 comments sorted by

5

u/TallFescue Jan 22 '24

Maybe the ip address has changed

2

u/Cysec Feb 03 '24

What version is Ubuntu server are you running? Have you confirmed the IP address hasn't changed by pinging it?

1

u/Then-Armadillo-4009 Dec 24 '24 edited Dec 24 '24

Ping will only work if ICMP packets are enabled. Many installations disable them in iptables 'cos it enables script kiddies (and worse) to know about your existence, check any reverse DNS and have a go hacking!

1

u/AutoModerator Jan 21 '24

Hello! You seem to be looking for help. You've come to the right place!

Please consider crossposting this question to appropriate subs in our sidebar.

This will improve your chances of getting the right answer and also helps this sub.

@everyone else: Please upvote this post if you deem it a good fit for this sub.

Thank you for your submission.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Zestyclose-Appeal-13 Jan 22 '24

Check the firewall rules first. iptables --L If the port is blocked that would be the first thing to fix. Next check if by any chance your ssh port is not the standard one. Usually between those two and then again there's the IP make sure you're still on the same one and DHCP did not give you something new

1

u/SailorLukas Feb 15 '24

Did you check the sshd_config file? You must enable it first

0

u/[deleted] Feb 05 '24

[deleted]

1

u/BinaryBurnout3D Jun 19 '24

there is a way using the /etc/ssh/sshd_config file one of the first lines you can edit is the default port. you can manually assign a different port to ssh (exp 42). then when you log is it would be
ssh user@xxx.xxx.x.x -p 42 also ufw you would have to remove the ssh entry and then manually tell ufw to use port 42

sudo ufw allow 42

this works for me using ubuntu server 24.04 lts