[Software] SSH take long to login

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
islam
Posts: 9
Joined: 2024-06-07 01:47

[Software] SSH take long to login

#1 Post by islam »

Hello I have a Debian 12 based VPS online but I am facing an issue with it the login using SSH taking to long time to login and some command hang how to troubleshoot this issue please and where should I search to know the reason of delay :D and btw when reboot my Debian the issue is fixed for sometime.

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2054
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 153 times
Been thanked: 213 times

Re: [Software] SSH take long to login

#2 Post by Hallvor »

Try pinging the remote server (replace "yourserverehere.com" with your real server):

Code: Select all

ping -c 4 yourserverhere.com

Also check DNS resolution

Code: Select all

dig yourserverhere.com

Then post the results here.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

islam
Posts: 9
Joined: 2024-06-07 01:47

Re: [Software] SSH take long to login

#3 Post by islam »

Hallvor wrote: 2024-06-10 19:28 Try pinging the remote server (replace "yourserverehere.com" with your real server):

Code: Select all

ping -c 4 yourserverhere.com

Also check DNS resolution

Code: Select all

dig yourserverhere.com

Then post the results here.
just one question do you want me to ping it from my windows laptop

islam
Posts: 9
Joined: 2024-06-07 01:47

Re: [Software] SSH take long to login

#4 Post by islam »

the result of dig the site

Code: Select all

[islamakkilah@localhost ~]$ dig master-schema.com

; <<>> DiG 9.16.23-RH <<>> master-schema.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39964
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;master-schema.com.		IN	A

;; ANSWER SECTION:
master-schema.com.	86360	IN	A	38.242.154.32

;; Query time: 16 msec
;; SERVER: 2a02:9b0:0:c433::ac#53(2a02:9b0:0:c433::ac)
;; WHEN: Mon Jun 10 22:33:34 +03 2024
;; MSG SIZE  rcvd: 51

islam
Posts: 9
Joined: 2024-06-07 01:47

Re: [Software] SSH take long to login

#5 Post by islam »

the result of ping master-schema.com where -c and 4 are not accepted
C:\Windows\system32>ping master-schema.com

Code: Select all

Pinging master-schema.com [38.242.154.32] with 32 bytes of data:
Reply from 38.242.154.32: bytes=32 time=124ms TTL=46
Reply from 38.242.154.32: bytes=32 time=140ms TTL=46
Reply from 38.242.154.32: bytes=32 time=376ms TTL=46
Reply from 38.242.154.32: bytes=32 time=129ms TTL=46

Ping statistics for 38.242.154.32:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 124ms, Maximum = 376ms, Average = 192ms

islam
Posts: 9
Joined: 2024-06-07 01:47

Re: [Software] SSH take long to login

#6 Post by islam »

I forget to mention when login is open the tab completion is not working also when I run the command like service mysql status it take long time

islam
Posts: 9
Joined: 2024-06-07 01:47

Re: [Software] SSH take long to login

#7 Post by islam »

any update

User avatar
Hetzer
Posts: 94
Joined: 2024-01-05 22:30
Location: /etc/fstab
Has thanked: 70 times
Been thanked: 31 times

Re: [Software] SSH take long to login

#8 Post by Hetzer »

Maybe check if "UseDNS" is set to "no" in /etc/ssh/sshd_config?
Listen carefully because I'll say it only once.

islam
Posts: 9
Joined: 2024-06-07 01:47

Re: [Software] SSH take long to login

#9 Post by islam »

Hetzer wrote: 2024-06-10 21:34 Maybe check if "UseDNS" is set to "no" in /etc/ssh/sshd_config?
yes brother correct I tried that but not working thank you :D

reinob
Posts: 1211
Joined: 2014-06-30 11:42
Has thanked: 109 times
Been thanked: 51 times

Re: [Software] SSH take long to login

#10 Post by reinob »

It seems that you are using a Windows client, not linux. So if the problem is related to the client, nobody is going to be able to help you.

The same applies if the problem is your connection. 100-300ms ping time is relatively high, so interactive sessions (ssh) will not be so smooth.

You haven't mentioned what kind of VPS is that, and what is running there. Maybe the RAM is tiny and you're running lots of things on it.

I would suggest you use "ssh -v <your-server>" (if whatever Windows client you're using, which you also didn't bother to mention, supports it). This will allow you to see where/when it hangs during log in.

Once you are in your VPS, you could run "free -h" and "uptime" and post the output here.

reinob
Posts: 1211
Joined: 2014-06-30 11:42
Has thanked: 109 times
Been thanked: 51 times

Re: [Software] SSH take long to login

#11 Post by reinob »

BTW I see it's a Contabo VPS. I used to have a couple of VPSs there and I ended up moving to Hetzner, because sometimes, for inexplicable reasons, they would run extremely slowly. Even booting (using VNC to look at it) was sometimes extremely slow.

Maybe it's overprovisioning, or a bad host disk, or who knows.

Post Reply