probine
asked on
How do I run a program in a remote computer ?
I have 2 computers: A and B.
Computer A is used to login into computer B through SSH.
Now, I would like to run a program in computer B, lets say firefox. I am already logged into computer B from computer A, so I can for example type: "mkdir aDir", or "kill 2558", and so on... all those commands work fine.
Conclusion: after a successfull login with SSH, in a console from computer A I can execute commands that take effect in computer B.
THE QUESTION:
How can I start a program in computer B from computer A ???
Computer A is used to login into computer B through SSH.
Now, I would like to run a program in computer B, lets say firefox. I am already logged into computer B from computer A, so I can for example type: "mkdir aDir", or "kill 2558", and so on... all those commands work fine.
Conclusion: after a successfull login with SSH, in a console from computer A I can execute commands that take effect in computer B.
THE QUESTION:
How can I start a program in computer B from computer A ???
What program are you attempting to start? Are you connecting from a Linux box or Windows box?
ASKER
I am using 2 Linux machines.
I want to start firefox.
I do not want to display the program in my computer, I want top open firefox in the remote computer.
I want to start firefox.
I do not want to display the program in my computer, I want top open firefox in the remote computer.
> I do not want to display the program in my computer, I want top open firefox in the remote computer.
Oh, You want to run firefox and You want to display it on remote screen.
In short - this is security issue(as You want to display on not owned screen) and it's impossible, but
if You sure the remote Xserver is started
export DISPLAY=:0
#steal authentication info, eg:
cp -av ~user_which_started_x/.Xau thority ~/
firefox
Oh, You want to run firefox and You want to display it on remote screen.
In short - this is security issue(as You want to display on not owned screen) and it's impossible, but
if You sure the remote Xserver is started
export DISPLAY=:0
#steal authentication info, eg:
cp -av ~user_which_started_x/.Xau
firefox
ASKER
ravenpl, can you explain this code :
#steal authentication info, eg:
cp -av ~user_which_started_x/.Xau thority ~/
firefox
#steal authentication info, eg:
cp -av ~user_which_started_x/.Xau
firefox
Xserver will refuse connection to itself unless it's set to accept any connection(rare ocasion) or You steal authentication info.
The info (magic cookie) is usually stored in ~/.Xauthority file of the user which started the X server
The info (magic cookie) is usually stored in ~/.Xauthority file of the user which started the X server
ASKER
Hi ravenpl ,
I don't see the logic on your code. I have tried:
cp -av ~user_which_started_x/.Xau thority ~/
and I get thist:
cp: `/home/testUser/.Xauthorit y' and `/home/testUser/.Xauthorit y' are the same file
I don't see the logic on your code. I have tried:
cp -av ~user_which_started_x/.Xau
and I get thist:
cp: `/home/testUser/.Xauthorit
OK, let me ask. How do You know remote box has the Xserver started?
You can't (normally) do that from ssh session, as You are not owner of the console...
You can't (normally) do that from ssh session, as You are not owner of the console...
ASKER
Well, in this case I am the one that installed both computer with Linux. I am the one that installed KDE in both of them and I am the one in control of both computer.
So I know that they both have X installed.
Your code is quite extrange... "cp -av ~user_which_started_x/.Xau thority ~/". It seems that this code doesn't copy anything in the remote machine, it only copies the same think in the same computer.
So I know that they both have X installed.
Your code is quite extrange... "cp -av ~user_which_started_x/.Xau
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
After You log in from A to B with ssh, any command You issue takes place on computer B.
But if You want use graphical applications, then login with
ssh -X [more options]
-X tells ssh to forward Xserver connection.
> How can I start a program in computer B from computer A ???
You do that. Or You want do it without using ssh, or without using password?