It’s been some time dealing with the loveliness of the nix command line. Much of it starting to come back to me now after several years away from the art. Anyways. I followed this post by Etel to sort of get my feet wet again and revive some of those creaky old mental boxes of knowledge about nix platform. Here’s the problem I’m having.
At the end of the post Etel says to modify the SSH config (definitely worth doing) to make adjustments to port used, etc. One of the parameters listed involves denying a login using the root account over SSH.
Ok, that sounds great! But, here’s the problem I’m running into with this.
Normally, when I logged in using the root acount, I would get something like this …
Using username “root”. Authenticating with public key “example-key-name” Passphrase for key “example-key-name”:
So, I would type the password and off I went!
When you apply the “PermitRootLogin” and “AllowUsers example-username” configuration (and restarting the ssh server of course) you are presented with this …
Using username “root”. Server refused our key root@example-ip’s password:
Perfectly normal I guess. That’s the restriction we wanted. So, we switch to the new added user in our SSH client. But, what’s this?
Using username “demo”. Server refused our key demo@example-ip’s password:
I am able to type the pw in and successfully login. But, HOLD ON! What happened to our nicely setup encrypted connection using those SSH keys!!! This will not do.
We are missing a step in Etel’s page or I’m blind, which as it happens I am LOL :), no really - I’m visually impaired :).
But, alas! Can someone explain the fix? Why was this step missed?
I did some poking around and came to the conclusion it has something to do with teh ~/.ssh folder.
chdown maybe? The question is— how does DigitalOcean inject the ssh keys into the distro so it’s ready for the root user?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!