Re: SSH -- Running remote command and NOT Exiting
On Wed, Mar 02, 2005 at 10:08:14PM -0500, Hal Vaughan wrote:
> I know I can use SSH to run a remote command like this:
>
> ssh newhost command-to-run
>
> And if I have it set up to use RSA or some other type of authentication, it'll
> connect to the system, log in automatically, and run "command-to-run", then
> log out.
>
> But I can't find anything in the man page (or on Google, but there's a high
> noise-to-signal ratio, including many copies of the man page) where I can
> tell ssh to run a command on login and NOT exit. What can I do to make ssh
> login, run a command, then stay logged in, waiting for another command?
Try this:
ssh -t host 'command ; bash -login'
-t is required to force pseudo-tty allocation. Without this it'll
work and you can type commands but bash doesn't give a prompt. Dunno
why that is.
--
Russell Steicke
-- Fortune says:
I do not know myself and God forbid that I should.
-- Johann Wolfgang von Goethe
Reply to: