cannot ssh server

0

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?

user607722

Posted 2011-12-21T13:26:02.547

Reputation: 103

1What is root's shell defined as in /etc/passwd? – Garrett – 2011-12-21T16:29:31.310

Answers

2

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

RedGrittyBrick

Posted 2011-12-21T13:26:02.547

Reputation: 70 632

You are right. Something unexpected is in bashrc. Thanks – user607722 – 2011-12-23T18:30:36.660