You are viewing a single comment's thread from:
RE: How to properly setup SSH Key Authentication - If you are logging into your server with root, you are doing it wrong!
I think a safer approach would be:
- Change root password
- Update Packages
- Admin Account Setup
- Create New User
- Add new user to sudo group
- Test login and sudo
- Disable root login
- Test ssh configuration with
sshd -T
- SSH Key Setup
- Create SSH Key
- Install SSH Key for new user
- Test SSH Key authentication
- Disable password authentication
- Test ssh configuration with
sshd -T
- Restart sshd
This breaks up Disable root login & password authentication into separate steps because it is safer. Instead of a kill switch at the end, vulnerabilities are removed in a sequence. First, a user is created and login to the user with sudo is tested and verified working. Then root logins are disabled. Next, key setup is handled along with disabling password logins.