EOA-Blockchain-Labs / ethereumonarm

Tools and scripts to build images that turn ARM devices into ful Ethereum nodes
GNU General Public License v3.0
143 stars 35 forks source link

Slow SSH logins #12

Open luisnaranjo733 opened 3 years ago

luisnaranjo733 commented 3 years ago

I noticed that SSH logins are excruciatingly slow with this Ubuntu server image.

I did some troubleshooting by passing the -vv flag to ssh to see what it was getting hung up on, and it was getting stuck on "pledge: network".

This is caused by an optional pluggable authentication module (PAM). https://serverfault.com/a/998761

Commenting out

session optional pam_systemd.so

in /etc/pam.d/common-session solves this slow SSH login issue. This might be worth adding to the rc.local via a sed command

sed -i 's|session\soptional\s\bpam_systemd.so|#session optional pam_systemd.so|g' /etc/pam.d/common-session

Sources:

luisnaranjo733 commented 3 years ago

Thinking out loud here, but it would be cool if you could specify an SSH public key when you generate your own custom image, and have SSH passwords disabled by default and have SSH configured so you can only login with that public key

https://www.coincashew.com/coins/overview-eth/guide-or-security-best-practices-for-a-eth2-validator-beaconchain-node#disable-ssh-password-authentication-and-use-ssh-keys-only

washosk commented 3 years ago

I will take a deeper look into this, bc in our test environment we never suffer this slowness, give my a few days to learn more about this and do further testing.