zoukankan      html  css  js  c++  java
  • start a GUI software on a remote Linux PC via SSH

    Is there a way to start a GUI software on a remote Linux PC via SSH?

    =>

    We just need to run export DISPLAY=:0 in ssh session and programs run will run on the remote display.

    eg:

    [null@AONT12 ~]$ssh null@192.168.8.11

    [null@AONT12 ~]$export DISPLAY=:0

    [null@AONT12 ~]$ firefox

    However when you close your ssh session, most of the time the remote application will close. If you want to disconnect from ssh but leave the application running you need to launch it in a special way using something like screen (keeps the ssh session running in the background) or nohup, or another method.

    we can shorten this all down into one command that will connect, export the display in-line and start the application in a way that won't close it after the ssh session dies

    [null@AONT12 ~]$ ssh null@192.168.8.11 "DISPLAY=:0 nohup firefox" 

  • 相关阅读:
    29 求和
    28 跳转控制语句 goto
    27 跳转控制语句 continue
    26 跳转控制语句 break
    25 打印金字塔
    24 打印九九乘法表
    23 多重循环控制
    22 do-while 循环
    21 while 循环
    20 for循环控制
  • 原文地址:https://www.cnblogs.com/nullbaby/p/7462759.html
Copyright © 2011-2022 走看看