Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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
share|improve this answer
Thanks, by default it's ssh key only, so I think it's probably safe, but I'll go ahead and give it a go. – James Nov 9 '11 at 16:10

As previously mentioned, moving from 'default' is almost always a good idea, security-wise. Changing your username from ubuntu to something else may prevent unauthorized access. However, every system has a 'root' account, and with it as an example, you can provide other measures of security for your machine/users.

  1. Ensure that root login is disabled.
  2. Prevent password login for users on your machine. (This is especially important in the case where your target username is known)
  3. Install a means of banning brute-force login attempts (fail2ban is a good option)
  4. Change your server port number.
  5. Whitelists are better than Blacklists. If you can tell your SSH server which IP's are allowed to connect, you can dramatically decrease attacks. (This can be complicated and cause problems in the future, so read and be prepared if you take it this far)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.