{"id":1993,"date":"2015-03-11T20:28:43","date_gmt":"2015-03-11T18:28:43","guid":{"rendered":"http:\/\/possiblelossofprecision.net\/?p=1993"},"modified":"2021-05-15T11:46:37","modified_gmt":"2021-05-15T09:46:37","slug":"sharing-a-screen-session-with-another-user","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1993","title":{"rendered":"Sharing a screen session with another user"},"content":{"rendered":"<p><a href=\"http:\/\/www.gnu.org\/software\/screen\/\">GNU screen<\/a> has builtin multiuser support that let&#8217;s you share a screen session with another user.<\/p>\n<p>First, create a screen session named with an arbitrary name, e.g. &#8216;shared&#8217;, and attach to it:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;user1@pc ~]$ screen -S shared\r\n<\/pre>\n<p>To allow other users to use the session, you need to enable multiuser support (<strong>Ctrl-a :multiuser on<\/strong>) and add the specific user(s) you want to share your session with to the access control list (<strong>Ctrl-a :acladd user2<\/strong>).<\/p>\n<p>If you try to attach to this session with a different user now, you might run into the following problem:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;user2@pc ~]$ screen -x user1\/shared\r\nMust run suid root for multiuser support.\r\n<\/pre>\n<p>To fix this, set the SUID bit on the screen binary:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;root@pc ~]# chmod u+s $(which screen)\r\n&#x5B;root@pc ~]# chmod 755 \/var\/run\/screen\r\n<\/pre>\n<p>You also need to change the permissions of the <code>\/var\/run\/screen<\/code> directory to <code>755<\/code>, otherwise screen will complain when you create a new session.<\/p>\n<p>You should be able to connect to the shared screen session now:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&#x5B;user2@pc ~]$ screen -x user1\/shared\r\n<\/pre>\n<p>If you run into <code>chmod \/dev\/pts\/2: Operation not permitted<\/code> remember that a user is not able to manipulate the pty he is on when you run <code>su - user<\/code> (in contrast to using <code>ssh user2@host<\/code>).<\/p>\n<p>Resources:<br \/>\n<a href=\"http:\/\/wiki.networksecuritytoolkit.org\/nstwiki\/index.php\/HowTo_Share_A_Terminal_Session_Using_Screen\">http:\/\/wiki.networksecuritytoolkit.org\/nstwiki\/index.php\/HowTo_Share_A_Terminal_Session_Using_Screen<\/a><br \/>\n<a href=\"https:\/\/www.gnu.org\/software\/screen\/manual\/screen.html\">https:\/\/www.gnu.org\/software\/screen\/manual\/screen.html<\/a><br \/>\n<a href=\"http:\/\/aperiodic.net\/screen\/multiuser\">http:\/\/aperiodic.net\/screen\/multiuser<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GNU screen has builtin multiuser support that let&#8217;s you share a screen session with another user. First, create a screen session named with an arbitrary name, e.g. &#8216;shared&#8217;, and attach to it: &#x5B;user1@pc ~]$ screen -S shared To allow other users to use the session, you need to enable multiuser support (Ctrl-a :multiuser on) and add the specific user(s) you&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=1993\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[28,71],"class_list":["post-1993","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bash","tag-screen"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1993"}],"version-history":[{"count":12,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1993\/revisions"}],"predecessor-version":[{"id":2004,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1993\/revisions\/2004"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}