eli jos olen kirjautunut graafiseen tilaan nimellä jorma ja avaan koneelleni toiselta koneelta ssh yhteyden ja kirjaudun tuolla samalla jorma-tunnuksella, niin voinko jotenkin antaa komentoja niin että käyttis luulisi ne tulevan tuolta graafiseen tilaan kirjautuneelta jormalta?
eli esimerkisi graafisessa tilassa on käynnissä realplayer. kun ssh:n kautta komennan realplay http://jossain.jotain.rm, niin tulee virheilmoitus että näyttöä ei voi avata.
eli esimerkisi graafisessa tilassa on käynnissä realplayer. kun ssh:n kautta komennan realplay http://jossain.jotain.rm, niin tulee virheilmoitus että näyttöä ei voi avata.
Vastaukset 5
Vanhimmat
aseta ssh-ikkunassa yhteyden muodostumisen jälkeen ympäristömuuttuja DISPLAY viittaamaan siihen koneeseen, johon haluat ikkunan syntyvän. Esim. bash-shellillä:
export DISPLAY=a.b.c.d:0
jossa korvaat kirjaimet a-d koneen IP-osoitteella.
Ensin pitää antaa DISPLAY muuttujalle arvo eli ohjelman pitää tietää missä on näyttö. Siis jotain malliin export DISPLAY=omakone:0.
Seuraavaksi pitää antaa tuolle ssh-konsolille antaa lupa käyttää äksää vaikka xhost-komennolla.
Sitten pitäisikin jo pelittää.
man ssh:
"X11 and TCP forwarding
If the ForwardX11 variable is set to ``yes'' (or see the description of the -X and -x options described later) and the user is using X11 (the DISPLAY environment variable is set), the connection to the X11 display is automatically forwarded to the remote side in such a way that any X11 programs started from the shell (or command) will go through the encrypted channel, and the connection to the real X server will be made from the local machine. The user should not manually set DISPLAY Forwarding of X11 connections can be configured on the command line or in configuration files.
The DISPLAY value set by ssh will point to the server machine, but with a display number greater than zero. This is normal, and happens because ssh creates a ``proxy'' X server on the server machine for forwarding the connections over the encrypted channel.
ssh will also automatically set up Xauthority data on the server machine. For this purpose, it will generate a random authorization cookie, store it in Xauthority on the server, and verify that any forwarded connections carry this cookie and replace it by the real cookie when the connection is opened. The real authentication cookie is never sent to the server machine (and no cookies are sent in the plain).
If the ForwardAgent variable is set to ``yes'' (or see the description of the -A and -a options described later) and the user is using an authentication agent, the connection to the agent is automatically forwarded to the remote side.
Forwarding of arbitrary TCP/IP connections over the secure channel can be specified either on the command line or in a configuration file. One possible application of TCP/IP forwarding is a secure connection to an electronic purse; another is going through firewalls."
Toimii, jos serveripuolen sshd:n konffeissa ei ole ohjausta erikseen kielletty.
Tarkoitus oli kai käynnistää etäkoneella oleva ohjelma etäkoneen äksään. Vai oliko?
pitää kokeilla noissa kahdessa ekassa vastauksessa ollutta ohjetta kun saan muijan koneelle vielä laitettua linuxin ja poistettua windowsin.
kiitokset kaikille vastaajille neuvoista!