On Mon, Nov 01, 2010 at 05:00:40PM +0000, Brett Parker wrote:
On 01 Nov 15:45, Chris G wrote:
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>
How about: ssh www-data@machine "cd /var/www/info/data/pages && exec bash -i"
Which certainly seems to work.
Yes, that works too of course as ssh waits for bash to exit, thank you!