ssh -X me@remotehost
sleep 1
cd profiles
source myenv
clear
After it logs in I want it to set up a large set of environment variables. I do this by sourcing a profile (called myenv above). I thought I could put this all into a shell script. The problem is that it tries to run the commands on the local host rather than the remote host, after it logs in. Is it possible to send these commands to the remote host?
You can pass a command to execute as the last parameter of the ssh. Typically, ssh executes the login shell (generally it is /bin/bash) for the logged in user but this can be altered to do what you want. You can have bash with custom profile loaded for you.
The best way I think would be to create a new profile in Konsole and put in ssh -X me@remotehost… The profiles don’t seem to do anything though.
I would change the .bashrc but that would that not hard code the login to a particular host…? I need to login to lots of different boxes: Solaris/HP-Ux…