Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-26-2005, 03:23 AM   #1
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 537

Rep: Reputation: 79
Change the prompt during ssh connections.

Hello there.

I was just wondering how to change the prompt when i'm connected to a remote computer by ssh because it's quite disturbing to have the same prompt all the time, and some time you even forget on which computer you are connected.
so i'm looking to have for exemple a prompt like
[user@localhost /path]# "when i'm on my computer"
[user@name of the remote computer /path]# "when i'm connected to the remote computer by ssh"

any idea with settings file should i edit and what the syntax use?

Last edited by angel115; 09-26-2005 at 03:24 AM.
Old 09-26-2005, 03:42 AM   #2
Lux Perpetua
LQ Newbie
Registered: Aug 2005
Location: Local Group
Distribution: Ubuntu Linux
Posts: 15

Rep: Reputation: 0
This is handled by the shell you are logged into. That shell probably has a startup script in your home directory which you can edit to your liking. For instance, if you use bash, this file is called .bashrc (so the path is ~/.bashrc). You can add or edit the "PS1" line to read something like
PS1='[\u@\h \w]# '
Repeat this for each of the machines you ssh into.
Old 09-26-2005, 04:02 AM   #3
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 537

Original Poster
Rep: Reputation: 79

it's work fine.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with SSH connections Kero-Chan Linux - Networking 10 10-15-2004 06:34 PM
SSH doesn't accept connections basse- Linux - Software 1 05-23-2004 07:33 AM
Can I see ssh connections? bruno buys Linux - Networking 4 11-19-2003 02:46 PM
SSH is blocking my connections tarballedtux Linux - Security 8 11-01-2002 04:19 PM
SSH - Refused Connections bfloeagle Linux - Networking 6 08-31-2001 12:16 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:13 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration