I am using a Windows machine and I connect to my remote host via a jump host using a SSH software (I use mobaxterm for now). Now my login process is like this:
Load the jump host session I have saved in mobaxterm (I have set up the ip, port, user name and passwd for the jump host)
Now I am in the jump host. I am prompted to select a server group. I enter a given number and press
Enter
key.I am prompted again to select a server. I enter another given number and press
Enter
key. Now I am on the remote server but with another user name.I use
su - $MYUSERNAME
command to switch account and I am prompted to enter my passwd for the remote host. After entering my passwd and pressEnter
key, I login into my own account in the remote host, finally!
Every time I open a new session in mobaxterm. I have to repeat the above process, which is rather boring and tedious. Are are there better ways in which I can automate this process so I can login into my final account without having to input these info every time?
expect
command (tcl,...) that typically is used for this sort of login. You might find more existing answers on stackoverflow, such as this one. – meuh Sep 9 '18 at 13:56