0

I am trying to connect to the server as root using ssh command in Ubuntu bash. I use

ssh -p port root@ip

to connect to the server and the config of ssh is a password-less connection ssh with the following commands:

ssh-keygen -t rsa -p ""
cat /home/{user}/.ssh/id_rsa.pub >> /home/{user}/.ssh/authorized_keys

After connecting to the server, I run the following command:

su hadoop

It shows hadoop@server:/root$ and after 5 secs shows root@server ~ # again and every button I press on the keyboard is not typed in the bash but after pressing enter I find out that the command is done. For example if I press ll, nothing is shown in the terminal but as soon as I press enter, the output of ll is shown.

I have checked that hadoop user is started with bash. By the way, I have Hadoop 2.7.7 and Hbase 1.2.4 started on this very server.
I guess it is because of Hbase running on my server because as soon as I stop it after being started for a while, the problem shows up. Please help me to fix it.

  • Please update your question with example of the exact code you are running. – Soren A Jul 20 at 15:34
  • Done! Please inform me if you need more information I can provide. – alirezafnatica Jul 20 at 15:48
  • Does your hadoop user on the remote machine have a valid home directory? what is its login shell?. I don't really understand why you create/copy a keypair for {user} if you are logging in as root - but that seems to be an unrelated issue. – steeldriver Jul 20 at 16:42
  • Yes it does. I can test it by su hadoop and then cd ~ and its login shel is BASH. – alirezafnatica Jul 20 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.