[SOLVED] Bash prompt issue when logging in via SSH
Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm wondering if someone can shed light on this for me:
When I log into my Fedora17 box using SSH as the user "tommy", I get an unexpected command line prompt from bash. When I SSH in as "johnny" I get a more conventional prompt. I looked at the files .bashrc and .bash_profile in each user's home directory to see if I could identify what is different; however, they appear to be the same. I don't see where else the prompt variable is set. Normally, I use "tommy" as the user account that I remotely access via SSH. This prompt is not helpful to me.
Below is the output I get from Putty when I log in as each user.
Using username "tommy".
Last login: Mon Sep 24 11:59:29 2012 from c-111-2-333-44.some.isp
Using username "johnny".
Last login: Mon Sep 24 11:59:57 2012 from c-111-2-333-44.some.isp
Habitual;4788413]Man, I must be stuck in a time warp, or a mental ward.
Why do I assume everyone uses bash? </rhethorical_Q>
I have ever seen as where there is no usernmae, hostname and pwd info (like [johnny@server ~]$) after logged in and also there is no command completion while we are using shell as /bin/sh. So I am guessing about login shell.
Last edited by mandyapenguin; 09-25-2012 at 12:11 AM.
Wow, thanks for the help! Just looking at your suggestions and looking in the home directories of each lead me to discover that tommy had no .bashrc file at all. For completeness, here are the results of the various commands:
-bash-4.2$ ls -al
drwxrwxr-x. 2 tommy users 4096 Sep 25 12:16 .
drwxr-xr-x. 6 root root 4096 Jul 8 18:27 ..
-rw------- 1 tommy tommy 360 Sep 24 12:00 .bash_history
-rw-r--r-- 1 tommy users 176 Sep 24 10:34 .bash_profile
-rw------- 1 tommy tommy 53 Sep 25 12:16 .Xauthority
-bash-4.2$ grep tommy /etc/passwd
[johnny@server ~]$ grep johnny /etc/passwd
[johnny@server ~]$ cat .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
# User specific aliases and functions
So the simplest answer was the one. I copied the .bashrc file over, reset the ownership, and the problem was resolved!
Using username "tommy".
Last login: Tue Sep 25 12:27:40 2012 from c-111-2-333-44.some.isp
Thank you, again, for your assistance. I know it's a minor thing, but it was irritating me!
Well, I guess I need to do a better job of searching...both here and on my own system. I should have noticed that the .bashrc file was missing for tommy. Root had it already, and so did johnny. I'm not sure how it got that way, but I learned some more about bash today. The link you provided would have been a good thread for me to have read before posting.
Thanks again to Habitual and mandyapenguin for your assistance.
Best regards to all...
(BTW, I didn't see an obvious way to mark this as solved; I'm not sure that matters on LQ Forum)