When I login server as root through ssh, I only see following message printed, but the prompt string is missing:

Last login: Wed Dec 21 08:12:26 2011 from xxx.xxx.xxx.xxx

I can type, but all command doesn't work. Only after I press ctrl-c, the prompt string shows up:

[root@xxxxxx~]#

Moreover, sftp does not work also for root. All other user on the system do not have such problem: no need ctrl-c to login, and sftp works well. Reboot doesn't solve the problem.

Anyone knows why?

link|improve this question
1  
What is root's shell defined as in /etc/passwd? – Garrett Dec 21 '11 at 16:29
feedback

migrated from stackoverflow.com Dec 21 '11 at 16:21

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

Check root's .login or .profile file and look to see whether it starts a program (perhaps accidentally).

For example, if root's .profile contains (note the typo)

filename=/something.txt
cat $filkname > /tmp/foo

this would cause the symptoms you describe

link|improve this answer
You are right. Something unexpected is in bashrc. Thanks – user607722 Dec 23 '11 at 18:30
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.