Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 3265  / 3 Years ago, thu, september 2, 2021, 9:30:09

I have a Amazon ec2 instance, and was curious on if I should change the username (the default is ubuntu) or not?



Since you need a public SSH key in order to access the server, I don't think you do, but the fact remains - should I change the username for that server?


More From » ssh

 Answers
4

Unless you have disabled user/password authentication on your server I would suggest changing it. From a security standpoint having one component of the authentication will make it easier.



Setting up SSH key authentication



User@Host:~$ ssh-keygen -t rsa -b 4096


after generating your key you would do the following:



User@Host:~$ ssh-copy-id <username>@<host>


You will then want to verify that the key is working before disabling password authentication.



User@Host:~$ ssh <username>@<host>


You should be prompted for the passphrase you established when you created the key. If you are and you connect to the server you can now disable password authentication.



modify your /etc/ssh/sshd_config by changing the following line:



ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no


After this you want to reload the SSH server



User@Host:~$ /etc/init.d/ssh reload

[#42200] Saturday, September 4, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scrubuz

Total Points: 194
Total Questions: 96
Total Answers: 127

Location: Monaco
Member since Fri, Sep 24, 2021
3 Years ago
;