I run Ubuntu 12.04 LTS on a virtual machine.
I regularly have to connect to my account on a university server, I do this by opening up terminal and using
ssh -Y email@example.com.
Once there I always have to run the following
setenv PYTHONPATH "place/stuff/this_goes_on_forever"
And also a few other lines of code.
What I want:
My main request: I would like to prepare a script and have that run automatically whenever I log in to the server via ssh.
This is a side query, but when I use
alias p="pwd"(for example) the new aliases do not 'take', typing
pin this case results in 'command not found'. Is this just a consequence of not being root, or because I am logged in via ssh, or is there a fix for this perhaps?
Attempts at a solution:
I tried adding
export PYTHONPATH="..." to my local
~/.bashrc file which means when I start terminal
PYTHONPATH is set, however after I
ssh to the server it is no longer set (well I have a whole new host of environment variables). I tried
~/.bash_profile after, didn't work.
I have tried adding
export PYTHONPATH="..." to the
~/.bash_profile file on the server, and also to the
~/.bashrc file- but neither worked.
I do not have root access on the server so cannot change
PermitUserEnvironement within the
sshd_config file on the server, it is just read-only.
Surely there is somewhere I can put this code, I just can't find where.