Hi!
The label in the EC2 console is based on the tag on the ec2 instance, specifically the tag called Name.
This has no bearing nor connection to what you see in the SSH session when logging into the server.
You can change that prompt that you see when SSH-ing in however.
By default, the prompt ubuntu@ip-NN-NNN-NN-NN:~$ is showing you the hostname of the server.
There's a few ways to change the prompt:
- Edit
/etc/hostnameto change the hostname, and then reboot the server (not recommended) - Edit
~/.bashrcand change thePS1variable. You want to replace\hwith anything else. The\hcharacter is saying to print the hostname. Then runsource ~/.bashrcto see that change reflected.
You can change that \h to anything you want, for example:
# FROM:
PS1='${debian_chroot:+($debian_chroot)}\[3[01;32m\]\u@\h\[3[00m\]:\[3[01;34m\]\w\[3[00m\]$ '
# TO:
PS1='${debian_chroot:+($debian_chroot)}\[3[01;32m\]\u@anything-i-want\[3[00m\]:\[3[01;34m\]\w\[3[00m\]$ '
Note that you can change both instances of the PS1 variable if there are multiple in that file.