I am logging into remote machine through shell script (by placing ssh command in script). After ssh command ,The remaining lines of the script are getting executed on the current machine rather than remote machine. How to make the rest of shell script lines execute on remote machine.?
Lets say this is my script
ssh username@ip-address
ls
whoami
----
The rest of lines after ssh should execute on remote machine rather than the current machine. How to achieve this?