The situation:
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 protected].
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', typingpin 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 AcceptEnv or 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.
echo $0.echo $0returns-tcshsetenv PYTHONPATH "place/stuff/this_goes_on_forever"to~/.tcshrcon the remote server. You can also usecsshon the server to change your default shell.chsh:) doesn't work since system admin has blocked it for non-root users. All problems now solved, just need to modify~/.tcshrcand when defining aliases use the correct syntax for tcsh/csh. Many thanks