Score:0

Show a tag in parentheses when connecting through SSH

cd flag

This is probably a pretty silly question, but one that I can't find the answer anywhere because of the description of the problem:

I have 2 linux servers. One is TEST and another is PROD

when I connect through SSH to them, this is what's shown:

(TEST) ubuntu@ip-XXX-XXX-XXX-XXX:

and

(PROD) ubuntu@ip-XXX-XXX-XXX-XXX:

How do you configure each server to show that tag? And how to manage it if I want to replace/remove?

EDIT: I've found out why but not sure how. The servers are hosted in AWS, so it's some custom Linux image they are using. The server is forwarding a parameter called "environment" in AWS tags into the bashrc but I can't find where is doing that

muru avatar
us flag
It's changing the `PS1` variable, probably somewhere in to the `.bashrc` or `/etc/bash.bashrc` files. Check those files in those servers.
Artur Meinild avatar
vn flag
The `PS1` variable can be used to both set the prompt, but also the title of the window in Xterm (between the codes `\e]0;` and `\a`). Also [see here](https://stackoverflow.com/questions/10456228/bash-ps1-window-title).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.