0

I'm coming from Windows, where I used to use Putty whenever I needed to connect to a server via SSH.

On MacOS this is much easier, as I can ssh into the server directly from the terminal. This is nice, but comes with a caveat: I might have a few terminal windows open at the same time, and mistake a terminal opened locally with a terminal ssh'ed into a remote server (and make nasty mistakes).

Is there any way I can visually distinguish a terminal window connected via ssh, from another one on my local machine?

1
  • Look to the title of the window, or the title of the tab if you are using several tabs.
    – 146438
    Commented Sep 13, 2019 at 16:13

2 Answers 2

1

Look to the title of the window, or the title of the tab if you are using several tabs:

enter image description here

That won't be enough for me to avoid making mistakes 😁 – Benjamin

I was thinking about something like the window changing color somewhere. Don't even know if that's technically possible, though. – Benjamin

Assuming a worst case when you are unable to change remote's prompt, edit you mac's terminal prompt in order to make most clear if the terminal is at a client of a Mac of yours.

If you use Tmux, configure non defaults status-fg status-bg so that your Mac's local terminals use a different Tmux color than what is configured at your servers.

2
  • That won't be enough for me to avoid making mistakes 😁
    – BenMorel
    Commented Sep 13, 2019 at 19:01
  • I was thinking about something like the window changing color somewhere. Don't even know if that's technically possible, though.
    – BenMorel
    Commented Sep 13, 2019 at 19:01
0

If you are willing to set-up powerline, you could have a prompt which shows if you are currently logged into a ssh session. This would be hard to miss. enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .