Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).


  Search this Thread
Old 11-04-2009, 11:48 AM   #1
LQ Newbie
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
How to change .bashrc prompt for logging in via SSH.

How do I change the .bashrc file to look different when using ssh to access my machine but stay the same for local logins? Thanks in advance.
Old 11-04-2009, 12:48 PM   #2
Registered: Nov 2009
Location: Lisbon, Portugal
Distribution: Gentoo, CentOs, Ubuntu, Debian
Posts: 182

Rep: Reputation: 49
When login by ssh the $SSH_TTY variable is set.

if [ ! -n "$SSH_TTY" ]; then
  export PS1="\[\e[32;1m\][\u@\[\e[34;1m\]\H \W]# \[\e[0m\]"  # Local login
  export PS1="ssh-\[\e[32;1m\][\u@\[\e[34;1m\]\H \W]# \[\e[0m\]" # Ssh Login


bashrc, ssh

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
.bashrc - how do I remove the working-directory from my prompt? oskar Linux - General 3 02-24-2007 09:04 AM
[SSH] Issue logging in [SSH & Permissions] MD3 Linux - Networking 11 12-10-2006 09:25 AM
Logging in Error in Fedora 5, /etc/bashrc command not found EmmaTheViking Linux - Newbie 10 05-24-2006 11:59 PM
[SOLVED] Change the prompt during ssh connections. angel115 Linux - Newbie 2 09-26-2005 04:02 AM
Logging in and getting login prompt again dkaplowitz Red Hat 5 11-21-2003 03:43 PM > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 03:16 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration