On Mon, Nov 01, 2010 at 03:06:21PM +0000, James Bensley wrote:
On 1 November 2010 14:41, Chris G cl@isbd.net wrote:
What I actually want to do at this particular moment is log onto my web server as www-data and change to different directories according to what I want to edit, e.g. :-
'info' - logs me on to the server as www-data and takes me to /var/www/info 'boat' - logs me on to the server as www-data and takes me to /var/www/boat etc.
Yes, I know it's rather trivial, but I find this sort of thing very useful.
Sounds like making a mountain out of a mole hill to me, when all you have to do upon initial log in is 'cd /to/the/dir' thats all your going to cut out?
Yes, true enough, I did say it was "rather trivial". It's slightly more than I said actually, I want to do "cd /var/www/info/data/pages" for the 'info' login and "cd /var/www/boat/data/pages" for the boat login.
I can't see you doing;
www-data@machine info
www-data@machine boat
as you can't parse an argument to an interactive session? I.e. AFAIK you either 'ssh user@machine' and have an interactive session or parse arguments that are executed and thats it, you can't parse an argument and have an interactive session I don't believe.
Yes, that's how I understand it too.
I have come up with a possible solution though:-
ssh -X -f -l www-data mws <script>
Where <script> executes a GUI application that runs in the required directory, in my case an editor. E.g. I do:-
ssh -X -f -l www-data mws ~/bin/info
and ~/bin/info on the target system is simply:-
cd /var/www/info/data/pages xvile
(xvile is a GUI editor, like gvim) Wierdly ~/bin/info is /home/chris/bin/info on the target system, not in www-data's bin directory.
One could probably make it more general by executing a terminal application but as the object of the exercise for me is to make it simple to edit specific virtual host web pages firing up the editor directly in the right place is what I want.