LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-11-2012, 12:19 PM   #1
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Rep: Reputation: 19
Weird behaviour


I just ordered a VPS running Ubuntu 12.04 LTS 64bit.

For some reason when I ssh into the machine and press the up arrow I get ^A[[ that shows. I've been searching on and off for two days and can't seem to find a solution.

Could someone please tell me how to get the history working correctly?

In addition, the .profile or .bash_profile file does not seem to be loading. I've tried setting my prompt to a color prompt but I get the same weird characters. I've tried setting the color_prompt=yes and force_color_prompt=yes but as mentioned the file doesn't seem to be loading.

The .bashrc file is only loading AFTER you enter a shell from within bash.
 
Old 07-11-2012, 12:48 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,207

Rep: Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684
what is the command you used to log in? What is your login shell?
 
Old 07-11-2012, 12:57 PM   #3
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Not really sure what you mean. My VPS is remote so I'm using the terminal on my laptop to ssh into with:

# ssh IP.ADDRESS -p PORT

The username is the same on my laptop as the remote server so it is attempting to login (successfully) with the same username.
 
Old 07-11-2012, 01:13 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,207

Rep: Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684
yes, that's fine: ssh host -p port is ok. You can check your shell by executing echo $0
 
Old 07-11-2012, 01:15 PM   #5
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
$ echo $0
-sh
 
1 members found this post helpful.
Old 07-11-2012, 01:17 PM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,207

Rep: Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684
try ssh host -p port bash --login -i
 
Old 07-11-2012, 01:22 PM   #7
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Same thing... I just tried that command to login via ssh and this is what I got after it logged in:

bash: no job control in this shell

There is still no color in the prompt and the arrow keys are still showing those weird characters.
 
Old 07-11-2012, 01:41 PM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,207

Rep: Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684Reputation: 7684
the strange behavior is caused because your login shell is sh, not bash. This is normal. You can try ssh as you did it before and execute bash on VPS. Have you modified your .profile, .bashrc or any other login related files? (and what about the /etc/profile?)
 
Old 07-11-2012, 09:49 PM   #9
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
I have edited the .bashrc and .profile files. I commented out the line saying to only load .bashrc if interactive mode.

How can I set it up to use bash instead of sh?
 
Old 07-12-2012, 01:01 PM   #10
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
I was able to get it working by going into the /etc/passwd file and changing the shell to bash.

Thanks for the help!
 
1 members found this post helpful.
Old 10-22-2012, 10:30 PM   #11
thegerm
LQ Newbie
 
Registered: May 2007
Location: Melbourne, Australia
Posts: 12

Rep: Reputation: 0
I'm having the same trouble on Ubuntu 12.02 server. I login from a windows PC with Putty. One one account everything is fine, the arrow keys and history work Ok. However, on another account on same server, the arrow keys work as described here.

Both accounts show as being bash shells and there is no difference between the .login and .bashrc files for both users.

Any ideas what the issue is here
..thegerm

Update: the problem was really as Jim Thorton posted, I changed the shell type in /etc/passwd with a 'chsh' command now it it works fine.

Last edited by thegerm; 10-23-2012 at 03:23 AM. Reason: update
 
  


Reply


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
[SOLVED] Weird behaviour of Debian, please help! codeman1234 Linux - Software 1 04-28-2012 05:54 PM
9.3 weird behaviour ????? bigjohn SUSE / openSUSE 9 07-06-2005 06:44 AM
[SOLVED] k3b weird behaviour filosophem Linux - Software 3 01-23-2005 05:42 PM
weird slit behaviour RaulConQ Linux - Software 7 10-31-2004 10:14 AM
Weird Apache behaviour ? rd2play Linux - Software 1 11-10-2003 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:21 PM.

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