One of the my main difficulties when I am administrating remote servers, its to identify the server that I'm working, once the shell is very similar between them (in fact, only the user is different in most cases).
I would like to know of is possible to create custom shells considering the remove server which I am connected.
Thanks for the help, Best regards!
If you mean custom shell prompt, take a look at the PS1 variable (man bash, search for PS1). It has lots of options. Here is a full guide, but for a start try
which gives you a prompt like
Are you leveraging the PS1 variable for customization? Not all versions of all shells handle the variable in the same manner, but most will accept a \h for hostname, \u for username, and \w for the current working directory.
Please see this page for additional options, examples, and suggestions.
regarding ps1 tweaks, this is what i use in my .bashrc
It'll give the username as red when root, green otherwise. and has the hostname and return code of last command. - might help you.
Also, try byobu (as suggested in comment to mrshunz)
Just use a unique and self-explanatory names for the hostname of your remote servers. Then, you will be able to know on which server you are working!
You can change the hostname from
/etc/hostname
. Restart the service/etc/init.d/hostname restart
. Also, don't forget to update the/etc/hosts
file.