{"id":337,"date":"2025-09-17T10:30:25","date_gmt":"2025-09-17T10:30:25","guid":{"rendered":"https:\/\/blog.chaiyakul.com\/?p=337"},"modified":"2025-09-17T10:30:25","modified_gmt":"2025-09-17T10:30:25","slug":"centos9-bash-gui-with-ssh-root","status":"publish","type":"post","link":"https:\/\/blog.chaiyakul.com\/index.php\/2025\/09\/17\/centos9-bash-gui-with-ssh-root\/","title":{"rendered":"CentOS9 \u0e23\u0e31\u0e19\u0e2a\u0e04\u0e23\u0e34\u0e1b\u0e15\u0e4c\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49 GUI \u0e14\u0e49\u0e27\u0e22 SSH"},"content":{"rendered":"\n<p><u><strong>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/strong><\/u><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# su - mill \nLast login: Thu Aug 14 17:17:25 +07 2025 on pts\/0 &#x5B;mill@localhost ~]$ export DISPLAY=:0 \n&#x5B;mill@localhost ~]$ xhost +SI:localuser:root sudo DISPLAY=:0 \/home\/mill\/restart_webviewer.sh\n<\/pre><\/div>\n\n\n<p><u><strong>\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e17\u0e35\u0e25\u0e30\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/strong><\/u><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsu - mill\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 <code>su<\/code> = <strong>switch user<\/strong> (\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49)<\/li>\n\n\n\n<li>\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2b\u0e21\u0e32\u0e22 <code>-<\/code> \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e42\u0e2b\u0e25\u0e14 environment \u0e02\u0e2d\u0e07 user \u0e19\u0e31\u0e49\u0e19\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19 login \u0e43\u0e2b\u0e21\u0e48<\/li>\n\n\n\n<li>\u0e15\u0e23\u0e07\u0e19\u0e35\u0e49\u0e04\u0e37\u0e2d\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e08\u0e32\u0e01 <code>root<\/code> \u0e44\u0e1b\u0e40\u0e1b\u0e47\u0e19 user \u0e0a\u0e37\u0e48\u0e2d <strong>mill<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nexport DISPLAY=:0\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e04\u0e48\u0e32 environment variable \u0e0a\u0e37\u0e48\u0e2d <code>DISPLAY<\/code><\/li>\n\n\n\n<li><code>:0<\/code> \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07 <strong>\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d\u0e2b\u0e25\u0e31\u0e01<\/strong> \u0e02\u0e2d\u0e07 X server (GUI \u0e02\u0e2d\u0e07 Linux)<\/li>\n\n\n\n<li>\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 GUI \u0e17\u0e35\u0e48\u0e40\u0e1b\u0e34\u0e14\u0e08\u0e32\u0e01 user <code>mill<\/code> \u0e08\u0e30\u0e16\u0e39\u0e01\u0e2a\u0e48\u0e07\u0e44\u0e1b\u0e41\u0e2a\u0e14\u0e07\u0e1a\u0e19\u0e08\u0e2d\u0e08\u0e23\u0e34\u0e07<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nxhost +SI:localuser:root\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><code>xhost<\/code> \u0e43\u0e0a\u0e49\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 X server (GUI)<\/li>\n\n\n\n<li><code>+SI:localuser:root<\/code> \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49 user <code>root<\/code> \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49 X server (\u0e08\u0e2d GUI) \u0e44\u0e14\u0e49<\/li>\n\n\n\n<li>\u0e16\u0e49\u0e32\u0e44\u0e21\u0e48\u0e17\u0e33\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49 <code>root<\/code> \u0e08\u0e30\u0e40\u0e1b\u0e34\u0e14\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 GUI \u0e44\u0e21\u0e48\u0e44\u0e14\u0e49 \u0e40\u0e1e\u0e23\u0e32\u0e30 X server \u0e08\u0e30\u0e1a\u0e25\u0e47\u0e2d\u0e01<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo DISPLAY=:0 \/home\/mill\/restart_webviewer.sh\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><code>sudo<\/code> = \u0e23\u0e31\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e14\u0e49\u0e27\u0e22\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c <code>root<\/code><\/li>\n\n\n\n<li><code>DISPLAY=:0<\/code> \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e43\u0e2b\u0e49 script \u0e17\u0e35\u0e48\u0e23\u0e31\u0e19 \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e1a\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d GUI \u0e44\u0e14\u0e49<\/li>\n\n\n\n<li><code>\/home\/mill\/restart_webviewer.sh<\/code> \u0e04\u0e37\u0e2d script \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e23\u0e31\u0e19 (\u0e40\u0e1b\u0e47\u0e19 shell script \u0e17\u0e35\u0e48\u0e19\u0e48\u0e32\u0e08\u0e30 restart \u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 webviewer)<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 \u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e17\u0e35\u0e25\u0e30\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","footnotes":""},"categories":[105,163,9],"tags":[],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-centos","category-gui","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":1,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"predecessor-version":[{"id":338,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/337\/revisions\/338"}],"wp:attachment":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}