I have a handy alias as follows:
sshpass -p "the_password" ssh -o StrictHostKeyChecking=no root@192.168.0.123
That will give me a quick way to login to a remote device, and get a command prompt which has tab completion.
But the first thing I then ALWAYS do, is cd
to a different directory. Consequently I want to add that as a command to the end of the line, like this:
sshpass -p "the_password" ssh -o StrictHostKeyChecking=no root@192.168.0.123 'cd /tmp/Data/fx'
But if I do that then I don't get a prompt at all! It just sits there doing nothing. Next, I tried to make it give me a command prompt, by using this:
sshpass -p "the_password" ssh -o StrictHostKeyChecking=no root@192.168.0.123 'cd /tmp/Data/fx; /bin/bash -i'
That nearly works.
I have changed to the right directory, and I have a command prompt. But, I don't have any tab-completion, and the up-arrow doesn't show me the most recent commands.
What am I missing?