{"id":279,"date":"2013-04-12T16:55:36","date_gmt":"2013-04-12T23:55:36","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=279"},"modified":"2013-07-01T13:06:49","modified_gmt":"2013-07-01T20:06:49","slug":"display-x-after-user-switch","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/display-x-after-user-switch\/","title":{"rendered":"Display X After User Switch"},"content":{"rendered":"

Sometimes you find yourself having to redirect the X display to a different host but \"ssh -X hostname\" will not work since you had to switch users. For instance you logged to a host as root and afterwards \"su - oracle\".<\/p>\n

Example:<\/p>\n

\r\n$ ssh root@host1.domain.com -X\r\n# echo $DISPLAY\r\nlocalhost:10.0\r\n# xauth list\r\nhost1.domain.com\/unix:11  MIT-MAGIC-COOKIE-1  95e4b887f2f6d132897aedbbbe297309\r\nhost1.domainom\/unix:10  MIT-MAGIC-COOKIE-1  961e9e854127e3c70ff8804a5eb57f7e\r\n# su - oracle\r\n$ xauth add host1.domain.com\/unix:10  MIT-MAGIC-COOKIE-1  961e9e854127e3c70ff8804a5eb57f7e\r\nxauth:  creating new authority file \/home\/oracle\/.Xauthority\r\n<\/pre>\n

Then trying xclock or xterm worked for me. \u00a0If you still have a problem also try:<\/p>\n

\r\n$ export DISPLAY=localhost:10.0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

Sometimes you find yourself having to redirect the X display to a different host but “ssh -X hostname” will not<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,26],"tags":[],"class_list":["post-279","post","type-post","status-publish","format-standard","hentry","category-linux","category-security"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}