{"id":1148,"date":"2011-06-09T12:41:16","date_gmt":"2011-06-09T04:41:16","guid":{"rendered":"http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/?p=1148"},"modified":"2011-06-09T12:41:16","modified_gmt":"2011-06-09T04:41:16","slug":"xming-xhost","status":"publish","type":"post","link":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/?p=1148","title":{"rendered":"xming xhost+"},"content":{"rendered":"<p>It is very convenient to have xming running in windows and ssh client  with X forwarding enabled , that to redirect  display from unix X- application to your windows . However, such remote display will be failed if you re-logon to become another user in the ssh teminal . So a command similar to &#8220;xhost&#8221; will be needed to run on windows in this case.<\/p>\n<p>To make that happens , in windows cmd prompt  you can start xming with &#8220;-ac&#8221; parameter to disable access control restrictions (that is similar to &#8220;xhost +&#8221; under unix variant) . Since that allow all display access from remote machines, so to make it a bit more secure, a long and arbitrary  display  number ,e.g. 1322 , can be given to xming as second parameter. Hence the command can be something like  &#8220;xming :1322 -ac&#8221;<br \/> .<br \/>\n<a href=\"http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/wp-content\/uploads\/2011\/06\/xming1.jpg\" title='' data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\"><img src='http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/wp-content\/uploads\/2011\/06\/xming1.jpg' alt='xming1.jpg' width=430 class=photo \/><\/a><\/p>\n<p>Logon as root through ssh client (with X forwarding enabled) and test with xclock  . Since it&#8217;s not default display port number, you have to set display as :<\/p>\n<blockquote>\n<p>\nsetenv DISPLAY pchost:1322.0\n<\/p>\n<\/blockquote>\n<p><a href=\"http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/wp-content\/uploads\/2011\/06\/xming23.JPG\" title='' data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\"><img src='http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/wp-content\/uploads\/2011\/06\/xming23.JPG' alt='xming23.JPG' width=530 class=photo \/><\/a><\/p>\n<p>Then logon as another user : user2 and test with ghostview   , but before that the display should be set again : <\/p>\n<blockquote>\n<p>\nsetenv DISPLAY pchost:1322.0\n<\/p>\n<\/blockquote>\n<p><a href=\"http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/wp-content\/uploads\/2011\/06\/xming31.JPG\" title='' data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\"><img src='http:\/\/www.se.cuhk.edu.hk\/~hmleung\/wordpress\/wp-content\/uploads\/2011\/06\/xming31.JPG' alt='xming31.JPG' width=530 class=photo  \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is very convenient to have xming running in windows and ssh client with X forwarding enabled , that to redirect display from unix X- application to your windows . However, such remote display&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1147,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1148","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1148"}],"version-history":[{"count":0,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1148\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/1147"}],"wp:attachment":[{"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www1.se.cuhk.edu.hk\/~hmleung\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}