Why are there 2 instanaces of Dropbear SSH?

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1858
Location: Hung Hom, Hong Kong

PostPosted: Tue Nov 30, 2021 14:47    Post subject: Why are there 2 instanaces of Dropbear SSH? Reply with quote
Why are there 2 instanaces of Dropbear SSH?
Code:
root:~# ps  | grep drop
 6288 root     dropbear -b /tmp/loginprompt -r /tmp/root/.ssh/ssh_host_rsa_key -p 22
 7027 root     dropbear -b /tmp/loginprompt -r /tmp/root/.ssh/ssh_host_rsa_key -p 22
 7034 root     grep drop

Could I reduce it to one so as to reduce CPU load?

I noticed that there is no service called "dropbear" but "sshd". Are they really the same?

BTW, I found that there were also 2 instances of Transmission!


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14244
Location: Texas, USA

PostPosted: Tue Nov 30, 2021 15:39    Post subject: Reply with quote
The sshd service calls dropbear:

https://github.com/mirror/dd-wrt/blob/master/src/router/services/services/sshd.c

I have a feeling that check_ps and start_sshd clash somewhere on init or something related to firewall or something else, but I would have to look at all the associated code. This has been this way for quite some time.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
hellf
DD-WRT Novice


Joined: 16 Apr 2010
Posts: 44
Location: Metavira

PostPosted: Wed Dec 01, 2021 10:38    Post subject: Re: Why are there 2 instanaces of Dropbear SSH? Reply with quote
mwchang wrote:
Why are there 2 instanaces of Dropbear SSH?
Code:
root:~# ps  | grep drop
 6288 root     dropbear -b /tmp/loginprompt -r /tmp/root/.ssh/ssh_host_rsa_key -p 22
 7027 root     dropbear -b /tmp/loginprompt -r /tmp/root/.ssh/ssh_host_rsa_key -p 22
 7034 root     grep drop

Could I reduce it to one so as to reduce CPU load?


The first/earlier instance (in your example 6288) is the daemon, listening for connections on port 22. The other one is your actual connection/active terminal session. Kill the first one and no new connection is possible (until the service restarts), kill the second one and your current connection is gone.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14244
Location: Texas, USA

PostPosted: Wed Dec 01, 2021 16:18    Post subject: Reply with quote
I knew someone would have the answer that I couldn't remember. Thanks for that clarification, @hellf!
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1858
Location: Hung Hom, Hong Kong

PostPosted: Thu Dec 02, 2021 12:30    Post subject: Re: Why are there 2 instanaces of Dropbear SSH? Reply with quote
hellf wrote:
The first/earlier instance (in your example 6288) is the daemon, listening for connections on port 22. The other one is your actual connection/active terminal session. Kill the first one and no new connection is possible (until the service restarts), kill the second one and your current connection is gone.

I remember one SSH connection one SSH server instance, but I forgot about the parent process.

Sorry...


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum