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. I suggest that you should use higher versions of hbase if you have the same problem. The only reason I didn't use higher versions for hbase was to be compatibile with hadoop, but now that I read the doc more carefully, I figured out hadoop 2.7.1+ is compatible with HBase 1.3.x and 1.4.x and 2.2.x. Of course I can't still trust that.
Please help me to fix it with your ideas.

  • Please update your question with example of the exact code you are running. – Soren A Jul 20 '19 at 15:34
  • Done! Please inform me if you need more information I can provide. – alirezafnatica Jul 20 '19 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 '19 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 '19 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.