I SSH into a multitude of different servers every day and some of them have different filesystem structures for their websites. Each time I change server, I have to work out where I'm going to get to the files I really want (because it's very rarely that I want to be in
I use Fabric files to automate all my actions (pushing to git, automated SSH to the server to pull from git, restarting the web application, changing dependencies, etc), so I was wondering if I couldn't also tell it that I want to SSH into the right directory so I can run
fab ssh and be in a normal SSH session, just in the right place and start working immediately.
This is not about Fabric though; please ignore it. Fabric is just running a batch of commands. My argument is with the
ssh command. That's what I'll be telling Fabric to run.
So how I can get
cd into a specific directory on login?
Note: this cannot be a server or user-wide thing. I have multiple websites under one user on some servers so sticking something in
~/.bashrc would not work for me.