Would it be possible to have the server name listed under the Centmin Mod Menu heading? -------------------------------------------------------- Centmin Mod Menu 123.09beta01 centminmod.com Server: sever1.domainname.com -------------------------------------------------------- I might have 2 or 3 terminal windows open at the same time. If I am looking at the menu, it would be nice to make sure I'm on the right server. I know it's other places, but a few times, when I was tired, I almost did something to the wrong server. Having it in the menu title would be another safeguard against doing something on the wrong server... for me at least. Just a suggestion.
not in the menu maybe someone outside of it ? fyi, if you have unique hostnames, the command prompt will be able to differentiate the servers too i.e. instead of server1.hostname.com, use webhostname-location-1.hostname.com so instead of [root@server1]# would be [root@webhostname-location-1]#
Where ever you feel it is best. Just something so that when I have 2 menus side by side, I know which one is which. Thought having it in the menu would good. Not sure where else it could go.
Yea, I often look at that because my naming convention is server1, server2, etc. It's also at the top of the terminal window. Mainly when I get tired and have two menus open at the same time, I've a few times, almost did the wrong thing because I was focused on the CMM menu vs. double checking which server / window.
Guess it's just habit.. I routinely have up to 10-30 server SSH windows open at a time, never had any probs
Hmmm worse case GitLab employee ran rm -rf on production LOL Gitlab employee accidentally deletes live data
-------------------------------------------------------- Centmin Mod Menu 123.09beta01 centminmod.com Server: sever1.domainname.com --------------------------------------------------------
changing command prompt BASH Shell: Change The Color of My Shell Prompt Under Linux or UNIX i.e. full hostname and cyan blue Code (Text): PS1="\e[0;36m[\u@\H \w]\\$ \e[m " full hostname and lighter cyan blue Code (Text): PS1="\e[1;36m[\u@\H \w]\\$ \e[m " hour:min, full hostname + lighter cyan blue Code (Text): PS1="\e[1;36m[\$(date +%H:%M)][\u@\H \w]\\$ \e[m " or Code (Text): PS1="\e[1;36m[\A][\u@\H \w]\\$ \e[m " hour:min, full hostname + lighter cyan blue + black background (How to Customize your Bash Prompt on a Linux VPS | DigitalOcean) Code (Text): PS1="\e[40;1;36m[\A][\u@\H \w]\\$ \e[m " example
Yes thinking of making the last one the default in Centmin Mod 123.09beta01 Code (Text): PS1="\e[40;1;36m[\A][\u@\H \w]\\$ \e[m " black terminals white terminals or with white text on black background Code (Text): PS1="\e[40;1;37m[\A][\u@\H \w]\\$ \e[m " clear enough for folks working with multiple SSH windows simultaneously or leave colours out of it and use Code (Text): PS1="[\u@\H \w]\\$ "
Non coloured based custom SSH command prompt implemented in latest 123.09beta01 code https://community.centminmod.com/th...t-for-clearer-identification-of-server.10300/. For existing Centmin Mod users, only takes affect next time you run centmin.sh and then exit your SSH session. Subsequent SSH sessions have the new custom prompt
Looks good! Should make things easier. Though, I'm thinking about using the colors too, because there is no mistaking colors.... unless you're color blind, which I'm not.
yeah i left out colours as folks maybe have custom SSH client/terminal colour schemes which may get kind of funky
Ended up going with this: Code: PS1="\e[32m[\u@\h \W]\\$ \e[m" If someone wants to add the time: Code: PS1="\e[32m[\A][\u@\h \W]\\$ \e[m" I'll change the color (32m) to what I want for each server based on this chart: 30: Black 31: Red 32: Green 33: Yellow 34: Blue 35: Purple 36: Cyan 37: White
also to prevent mishaps, can setup custom alias command for pwd command = list present working directory to also display hostname i.e. alias pwdh command Code (Text): alias pwdh='echo -n "$(hostname) "; pwd' so when you type pwdh Code (Text): pwdh host1.domain.com /root Code (Text): cd /home/nginx pwdh host1.domain.com /home/nginx edit: hmmm pwd won't work in .bashrc heh which needs a bit more tweaking to inset into /root/.bashrc with echo Code (Text): echo "alias pwdh='echo -n \"\$HOSTNAME\"; echo \" \$PWD\"'" >> /root/.bashrc after echo append to /root/.bashrc, the entry would appear as Code (Text): alias pwdh='echo -n "$HOSTNAME"; echo " $PWD"'