I am using ssh on my linux to remote access a second linux. What ssh does is to make my Linux's Terminal the remote Linux's Terminal, and whatever I entered in my Terminal would be executed on the remote Linux. Now I want to use a Shell script to enter a command after the remote access has been established.
I use the following bash to do the ssh part:
#!/bin/sh
ssh user@192.168.178.160
after this it prompts a password which is fine, I enter the password and the I am connected to the remote host. but after that I need to enter some additional commands to be executed automatically ( also from shell script) but simply entering them after the above code lines doesn't work.
Any ideas how to do this?