Changing the AWS Shell Prompt Without Affecting the Hostname

If you do not want to modify the hostname for your instance, but you would like to have a more useful system name (such as webserver) displayed than the private name supplied by AWS (for example, ip-12-34-56-78), you can edit the shell prompt configuration files to display your system nickname instead of the hostname.

Edit the file and change the shell prompt variable (PS1) to display your nickname instead of the hostname. Find the following line that sets the shell prompt in /etc/bashrc (several surrounding lines are shown below for context; look for the line that starts with [ “$PS1”):

And change the \h (the symbol for hostname) in that line to the value of the NICKNAME variable.

Log out and then log back in to pick up the new nickname value.

source: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-hostname.html