How could I debug sshd taking several minutes to start? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionVirtualbox seamless mode in Bodhi LinuxHow do I start a virtual machine in background upon OSX system start?arch Linux boots into grub command linePasswordless login only works using directly invoked sshd on serverCentOS7 server VirtualBox guest on Ubuntu 15.10 screen issueWhy is it taking so long to establish a LAN connection on boot?What network settings need to be changed in order to access my guest oracle linux pre-built VM from my host?Prevent maximised window from using top few lines of the screen, in kdeDesktop doesn't lock when running VirtualboxUbuntu VirtualBox stuck before login screen
Uniqueness of spanning tree on a grid.
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
Why didn't Eitri join the fight?
Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?
Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source
Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?
Amount of permutations on an NxNxN Rubik's Cube
Would "destroying" Wurmcoil Engine prevent its tokens from being created?
When was Kai Tak permanently closed to cargo service?
An adverb for when you're not exaggerating
Why are both D and D# fitting into my E minor key?
Is "Reachable Object" really an NP-complete problem?
Is it a good idea to use CNN to classify 1D signal?
Do jazz musicians improvise on the parent scale in addition to the chord-scales?
How does the math work when buying airline miles?
Do I really need to have a message in a novel to appeal to readers?
Is it fair for a professor to grade us on the possession of past papers?
Compare a given version number in the form major.minor.build.patch and see if one is less than the other
How come Sam didn't become Lord of Horn Hill?
Is there such thing as an Availability Group failover trigger?
Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?
Closed form of recurrent arithmetic series summation
What does "lightly crushed" mean for cardamon pods?
How to convince students of the implication truth values?
How could I debug sshd taking several minutes to start?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionVirtualbox seamless mode in Bodhi LinuxHow do I start a virtual machine in background upon OSX system start?arch Linux boots into grub command linePasswordless login only works using directly invoked sshd on serverCentOS7 server VirtualBox guest on Ubuntu 15.10 screen issueWhy is it taking so long to establish a LAN connection on boot?What network settings need to be changed in order to access my guest oracle linux pre-built VM from my host?Prevent maximised window from using top few lines of the screen, in kdeDesktop doesn't lock when running VirtualboxUbuntu VirtualBox stuck before login screen
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I use a VM with ssh and X forwarding to run certain applications. When launching the VirtualBox VM, it takes several minutes for ssh to come online, even though the machine is at the desktop environment's login prompt in no time. The machine does not use a lot of resources (CPU, network) while sshd is starting.
Other things that might need to understand the issue:
- The host is a Debian Buster (testing) system running
OpenSSH_7.9p1 Debian-1, OpenSSL 1.1.1 11 Sep 2018
- When I log in on the desktop environment, it also takes a bit, but usually not multiple minutes. It accepts my login (or tells me I typo'd) immediately and switches to a blank screen, but takes a while to show the actual desktop.
- Once the desktop is shown and I can start to debug the issue, the issue has disappeared: sshd invariably works when the desktop environment has loaded. They both seem to block on the same thing.
- While sshd is not yet up, the system responds with "connection refused", i.e. it can reach the host and port, but sshd seems not to have bound to it.
- I can also ping the host, immediately from the moment the boot screen changes to the desktop environment's login prompt. The system seems fully ready, except sshd does not start (or bind to the interface).
Switching to a virtual terminal does not work because it switches to a virtual terminal of my host system, even if set the keyboard to be captured. I could prevent the desktop env from booting and get a terminal immediately, but I only have a short amount of time (2-3 minutes I'd say) so I would have to reboot after every few commands or know where to look in order to figure it out.
How could I debug this issue effectively? Is there a likely cause that I could check?
networking boot virtualbox openssh sshd
add a comment |
I use a VM with ssh and X forwarding to run certain applications. When launching the VirtualBox VM, it takes several minutes for ssh to come online, even though the machine is at the desktop environment's login prompt in no time. The machine does not use a lot of resources (CPU, network) while sshd is starting.
Other things that might need to understand the issue:
- The host is a Debian Buster (testing) system running
OpenSSH_7.9p1 Debian-1, OpenSSL 1.1.1 11 Sep 2018
- When I log in on the desktop environment, it also takes a bit, but usually not multiple minutes. It accepts my login (or tells me I typo'd) immediately and switches to a blank screen, but takes a while to show the actual desktop.
- Once the desktop is shown and I can start to debug the issue, the issue has disappeared: sshd invariably works when the desktop environment has loaded. They both seem to block on the same thing.
- While sshd is not yet up, the system responds with "connection refused", i.e. it can reach the host and port, but sshd seems not to have bound to it.
- I can also ping the host, immediately from the moment the boot screen changes to the desktop environment's login prompt. The system seems fully ready, except sshd does not start (or bind to the interface).
Switching to a virtual terminal does not work because it switches to a virtual terminal of my host system, even if set the keyboard to be captured. I could prevent the desktop env from booting and get a terminal immediately, but I only have a short amount of time (2-3 minutes I'd say) so I would have to reboot after every few commands or know where to look in order to figure it out.
How could I debug this issue effectively? Is there a likely cause that I could check?
networking boot virtualbox openssh sshd
1
maybe dns resolve error.
– Ipor Sircer
Nov 22 '18 at 9:29
@IporSircer I was thinking DNS might be it, but what could I do to fix it? Resolvconf seems to work correctly as, after booting, dns works fine.
– Luc
Nov 22 '18 at 9:50
It seems that I have the same problem: Debian in a VM, takes more than a minutes to start sshd. I tried tuning it via /etc/ssh/sshd_conf, disabling DNS lookup, added verbose logs, etc. but it is still slow and I am not sure what is causing it. It looks like sshd starts to print logs (in /var/log/auth.log) only after it has been fully started, so it does not help much in decided why it is starting so slow.
– dying_sphynx
Dec 11 '18 at 10:26
The interesting thing is that when I login into that Debian VM (i.e. type my login and password in the terminal), then it start quicker: "Startup finished in 2.878s (kernel) + 9.890s (userspace)" (in /var/log/daemon.log). But if I just start the VM without logging in and want to log in via SSH from my main machine, sshd starts for more than a minute (I can see it in /var/log/daemon.log again). It seems like logging in causes it to start quicker (perhaps some other service, like networking starts as soon as one logs in, I don't know)
– dying_sphynx
Dec 11 '18 at 10:32
@dying_sphynx That sounds 100% like what I'm seeing. I haven't had a chance to debug this issue yet, maybe next week. I'll keep you posted if I do!
– Luc
Dec 11 '18 at 10:51
add a comment |
I use a VM with ssh and X forwarding to run certain applications. When launching the VirtualBox VM, it takes several minutes for ssh to come online, even though the machine is at the desktop environment's login prompt in no time. The machine does not use a lot of resources (CPU, network) while sshd is starting.
Other things that might need to understand the issue:
- The host is a Debian Buster (testing) system running
OpenSSH_7.9p1 Debian-1, OpenSSL 1.1.1 11 Sep 2018
- When I log in on the desktop environment, it also takes a bit, but usually not multiple minutes. It accepts my login (or tells me I typo'd) immediately and switches to a blank screen, but takes a while to show the actual desktop.
- Once the desktop is shown and I can start to debug the issue, the issue has disappeared: sshd invariably works when the desktop environment has loaded. They both seem to block on the same thing.
- While sshd is not yet up, the system responds with "connection refused", i.e. it can reach the host and port, but sshd seems not to have bound to it.
- I can also ping the host, immediately from the moment the boot screen changes to the desktop environment's login prompt. The system seems fully ready, except sshd does not start (or bind to the interface).
Switching to a virtual terminal does not work because it switches to a virtual terminal of my host system, even if set the keyboard to be captured. I could prevent the desktop env from booting and get a terminal immediately, but I only have a short amount of time (2-3 minutes I'd say) so I would have to reboot after every few commands or know where to look in order to figure it out.
How could I debug this issue effectively? Is there a likely cause that I could check?
networking boot virtualbox openssh sshd
I use a VM with ssh and X forwarding to run certain applications. When launching the VirtualBox VM, it takes several minutes for ssh to come online, even though the machine is at the desktop environment's login prompt in no time. The machine does not use a lot of resources (CPU, network) while sshd is starting.
Other things that might need to understand the issue:
- The host is a Debian Buster (testing) system running
OpenSSH_7.9p1 Debian-1, OpenSSL 1.1.1 11 Sep 2018
- When I log in on the desktop environment, it also takes a bit, but usually not multiple minutes. It accepts my login (or tells me I typo'd) immediately and switches to a blank screen, but takes a while to show the actual desktop.
- Once the desktop is shown and I can start to debug the issue, the issue has disappeared: sshd invariably works when the desktop environment has loaded. They both seem to block on the same thing.
- While sshd is not yet up, the system responds with "connection refused", i.e. it can reach the host and port, but sshd seems not to have bound to it.
- I can also ping the host, immediately from the moment the boot screen changes to the desktop environment's login prompt. The system seems fully ready, except sshd does not start (or bind to the interface).
Switching to a virtual terminal does not work because it switches to a virtual terminal of my host system, even if set the keyboard to be captured. I could prevent the desktop env from booting and get a terminal immediately, but I only have a short amount of time (2-3 minutes I'd say) so I would have to reboot after every few commands or know where to look in order to figure it out.
How could I debug this issue effectively? Is there a likely cause that I could check?
networking boot virtualbox openssh sshd
networking boot virtualbox openssh sshd
edited Nov 24 '18 at 18:48
Rui F Ribeiro
42.1k1484142
42.1k1484142
asked Nov 22 '18 at 9:21
LucLuc
1,00411021
1,00411021
1
maybe dns resolve error.
– Ipor Sircer
Nov 22 '18 at 9:29
@IporSircer I was thinking DNS might be it, but what could I do to fix it? Resolvconf seems to work correctly as, after booting, dns works fine.
– Luc
Nov 22 '18 at 9:50
It seems that I have the same problem: Debian in a VM, takes more than a minutes to start sshd. I tried tuning it via /etc/ssh/sshd_conf, disabling DNS lookup, added verbose logs, etc. but it is still slow and I am not sure what is causing it. It looks like sshd starts to print logs (in /var/log/auth.log) only after it has been fully started, so it does not help much in decided why it is starting so slow.
– dying_sphynx
Dec 11 '18 at 10:26
The interesting thing is that when I login into that Debian VM (i.e. type my login and password in the terminal), then it start quicker: "Startup finished in 2.878s (kernel) + 9.890s (userspace)" (in /var/log/daemon.log). But if I just start the VM without logging in and want to log in via SSH from my main machine, sshd starts for more than a minute (I can see it in /var/log/daemon.log again). It seems like logging in causes it to start quicker (perhaps some other service, like networking starts as soon as one logs in, I don't know)
– dying_sphynx
Dec 11 '18 at 10:32
@dying_sphynx That sounds 100% like what I'm seeing. I haven't had a chance to debug this issue yet, maybe next week. I'll keep you posted if I do!
– Luc
Dec 11 '18 at 10:51
add a comment |
1
maybe dns resolve error.
– Ipor Sircer
Nov 22 '18 at 9:29
@IporSircer I was thinking DNS might be it, but what could I do to fix it? Resolvconf seems to work correctly as, after booting, dns works fine.
– Luc
Nov 22 '18 at 9:50
It seems that I have the same problem: Debian in a VM, takes more than a minutes to start sshd. I tried tuning it via /etc/ssh/sshd_conf, disabling DNS lookup, added verbose logs, etc. but it is still slow and I am not sure what is causing it. It looks like sshd starts to print logs (in /var/log/auth.log) only after it has been fully started, so it does not help much in decided why it is starting so slow.
– dying_sphynx
Dec 11 '18 at 10:26
The interesting thing is that when I login into that Debian VM (i.e. type my login and password in the terminal), then it start quicker: "Startup finished in 2.878s (kernel) + 9.890s (userspace)" (in /var/log/daemon.log). But if I just start the VM without logging in and want to log in via SSH from my main machine, sshd starts for more than a minute (I can see it in /var/log/daemon.log again). It seems like logging in causes it to start quicker (perhaps some other service, like networking starts as soon as one logs in, I don't know)
– dying_sphynx
Dec 11 '18 at 10:32
@dying_sphynx That sounds 100% like what I'm seeing. I haven't had a chance to debug this issue yet, maybe next week. I'll keep you posted if I do!
– Luc
Dec 11 '18 at 10:51
1
1
maybe dns resolve error.
– Ipor Sircer
Nov 22 '18 at 9:29
maybe dns resolve error.
– Ipor Sircer
Nov 22 '18 at 9:29
@IporSircer I was thinking DNS might be it, but what could I do to fix it? Resolvconf seems to work correctly as, after booting, dns works fine.
– Luc
Nov 22 '18 at 9:50
@IporSircer I was thinking DNS might be it, but what could I do to fix it? Resolvconf seems to work correctly as, after booting, dns works fine.
– Luc
Nov 22 '18 at 9:50
It seems that I have the same problem: Debian in a VM, takes more than a minutes to start sshd. I tried tuning it via /etc/ssh/sshd_conf, disabling DNS lookup, added verbose logs, etc. but it is still slow and I am not sure what is causing it. It looks like sshd starts to print logs (in /var/log/auth.log) only after it has been fully started, so it does not help much in decided why it is starting so slow.
– dying_sphynx
Dec 11 '18 at 10:26
It seems that I have the same problem: Debian in a VM, takes more than a minutes to start sshd. I tried tuning it via /etc/ssh/sshd_conf, disabling DNS lookup, added verbose logs, etc. but it is still slow and I am not sure what is causing it. It looks like sshd starts to print logs (in /var/log/auth.log) only after it has been fully started, so it does not help much in decided why it is starting so slow.
– dying_sphynx
Dec 11 '18 at 10:26
The interesting thing is that when I login into that Debian VM (i.e. type my login and password in the terminal), then it start quicker: "Startup finished in 2.878s (kernel) + 9.890s (userspace)" (in /var/log/daemon.log). But if I just start the VM without logging in and want to log in via SSH from my main machine, sshd starts for more than a minute (I can see it in /var/log/daemon.log again). It seems like logging in causes it to start quicker (perhaps some other service, like networking starts as soon as one logs in, I don't know)
– dying_sphynx
Dec 11 '18 at 10:32
The interesting thing is that when I login into that Debian VM (i.e. type my login and password in the terminal), then it start quicker: "Startup finished in 2.878s (kernel) + 9.890s (userspace)" (in /var/log/daemon.log). But if I just start the VM without logging in and want to log in via SSH from my main machine, sshd starts for more than a minute (I can see it in /var/log/daemon.log again). It seems like logging in causes it to start quicker (perhaps some other service, like networking starts as soon as one logs in, I don't know)
– dying_sphynx
Dec 11 '18 at 10:32
@dying_sphynx That sounds 100% like what I'm seeing. I haven't had a chance to debug this issue yet, maybe next week. I'll keep you posted if I do!
– Luc
Dec 11 '18 at 10:51
@dying_sphynx That sounds 100% like what I'm seeing. I haven't had a chance to debug this issue yet, maybe next week. I'll keep you posted if I do!
– Luc
Dec 11 '18 at 10:51
add a comment |
1 Answer
1
active
oldest
votes
Most likely lack of entropy. In the comments, you have confirmed that doing some activity on the box makes sshd
start quicker - that happens because your activity contributes to the entropy sources.
Install (and make sure it gets started) haveged
(or, in older distributions, rngd
).
I hadn't thought of that as a possible cause, and that would indeed match the symptoms! As far as I know, though, Debian saves an entropy file on shutdown. I'll investigate at work next week. (Though the issue seems to have resolved itself at some point after installing updates, I still have an old VM to test with. If this was the issue, I'll mark the answer as accepted of course.)
– Luc
Apr 13 at 19:07
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483392%2fhow-could-i-debug-sshd-taking-several-minutes-to-start%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Most likely lack of entropy. In the comments, you have confirmed that doing some activity on the box makes sshd
start quicker - that happens because your activity contributes to the entropy sources.
Install (and make sure it gets started) haveged
(or, in older distributions, rngd
).
I hadn't thought of that as a possible cause, and that would indeed match the symptoms! As far as I know, though, Debian saves an entropy file on shutdown. I'll investigate at work next week. (Though the issue seems to have resolved itself at some point after installing updates, I still have an old VM to test with. If this was the issue, I'll mark the answer as accepted of course.)
– Luc
Apr 13 at 19:07
add a comment |
Most likely lack of entropy. In the comments, you have confirmed that doing some activity on the box makes sshd
start quicker - that happens because your activity contributes to the entropy sources.
Install (and make sure it gets started) haveged
(or, in older distributions, rngd
).
I hadn't thought of that as a possible cause, and that would indeed match the symptoms! As far as I know, though, Debian saves an entropy file on shutdown. I'll investigate at work next week. (Though the issue seems to have resolved itself at some point after installing updates, I still have an old VM to test with. If this was the issue, I'll mark the answer as accepted of course.)
– Luc
Apr 13 at 19:07
add a comment |
Most likely lack of entropy. In the comments, you have confirmed that doing some activity on the box makes sshd
start quicker - that happens because your activity contributes to the entropy sources.
Install (and make sure it gets started) haveged
(or, in older distributions, rngd
).
Most likely lack of entropy. In the comments, you have confirmed that doing some activity on the box makes sshd
start quicker - that happens because your activity contributes to the entropy sources.
Install (and make sure it gets started) haveged
(or, in older distributions, rngd
).
edited Apr 13 at 19:24
answered Apr 13 at 17:31
RichlvRichlv
405311
405311
I hadn't thought of that as a possible cause, and that would indeed match the symptoms! As far as I know, though, Debian saves an entropy file on shutdown. I'll investigate at work next week. (Though the issue seems to have resolved itself at some point after installing updates, I still have an old VM to test with. If this was the issue, I'll mark the answer as accepted of course.)
– Luc
Apr 13 at 19:07
add a comment |
I hadn't thought of that as a possible cause, and that would indeed match the symptoms! As far as I know, though, Debian saves an entropy file on shutdown. I'll investigate at work next week. (Though the issue seems to have resolved itself at some point after installing updates, I still have an old VM to test with. If this was the issue, I'll mark the answer as accepted of course.)
– Luc
Apr 13 at 19:07
I hadn't thought of that as a possible cause, and that would indeed match the symptoms! As far as I know, though, Debian saves an entropy file on shutdown. I'll investigate at work next week. (Though the issue seems to have resolved itself at some point after installing updates, I still have an old VM to test with. If this was the issue, I'll mark the answer as accepted of course.)
– Luc
Apr 13 at 19:07
I hadn't thought of that as a possible cause, and that would indeed match the symptoms! As far as I know, though, Debian saves an entropy file on shutdown. I'll investigate at work next week. (Though the issue seems to have resolved itself at some point after installing updates, I still have an old VM to test with. If this was the issue, I'll mark the answer as accepted of course.)
– Luc
Apr 13 at 19:07
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483392%2fhow-could-i-debug-sshd-taking-several-minutes-to-start%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
maybe dns resolve error.
– Ipor Sircer
Nov 22 '18 at 9:29
@IporSircer I was thinking DNS might be it, but what could I do to fix it? Resolvconf seems to work correctly as, after booting, dns works fine.
– Luc
Nov 22 '18 at 9:50
It seems that I have the same problem: Debian in a VM, takes more than a minutes to start sshd. I tried tuning it via /etc/ssh/sshd_conf, disabling DNS lookup, added verbose logs, etc. but it is still slow and I am not sure what is causing it. It looks like sshd starts to print logs (in /var/log/auth.log) only after it has been fully started, so it does not help much in decided why it is starting so slow.
– dying_sphynx
Dec 11 '18 at 10:26
The interesting thing is that when I login into that Debian VM (i.e. type my login and password in the terminal), then it start quicker: "Startup finished in 2.878s (kernel) + 9.890s (userspace)" (in /var/log/daemon.log). But if I just start the VM without logging in and want to log in via SSH from my main machine, sshd starts for more than a minute (I can see it in /var/log/daemon.log again). It seems like logging in causes it to start quicker (perhaps some other service, like networking starts as soon as one logs in, I don't know)
– dying_sphynx
Dec 11 '18 at 10:32
@dying_sphynx That sounds 100% like what I'm seeing. I haven't had a chance to debug this issue yet, maybe next week. I'll keep you posted if I do!
– Luc
Dec 11 '18 at 10:51