{"id":1477,"date":"2014-09-25T14:12:10","date_gmt":"2014-09-25T22:12:10","guid":{"rendered":"http:\/\/chriscarey.com\/?p=1477"},"modified":"2014-09-25T14:16:39","modified_gmt":"2014-09-25T22:16:39","slug":"start-a-screen-session-as-another-user-at-system-startup","status":"publish","type":"post","link":"https:\/\/chriscarey.com\/blog\/2014\/09\/25\/start-a-screen-session-as-another-user-at-system-startup\/","title":{"rendered":"Start a screen session as another user at system startup"},"content":{"rendered":"<p>Came across this technique to get a screen session started as another non-root user on system startup. You could have this command in \/etc\/rc.local or any other location that runs on system startup as root.<\/p>\n<p>Also, it doesn&#8217;t have to just be at system startup. These commands could be used at any time by the root user to start a screen session for another user.<\/p>\n<p>This command must run as <strong>root<\/strong>. I had best luck when providing full paths to the executable and optional file arguments (like if you are passing a conf file)<\/p>\n<div class=\"codecolorer-container text blackboard\" style=\"overflow:auto;white-space:nowrap;width:565px;\"><div class=\"text codecolorer\">su - username -c &quot;\/usr\/bin\/screen -dmS screenname .\/executable&quot;<\/div><\/div>\n<p>So, for example, to get <strong>irssi<\/strong> started as <strong>chris<\/strong> in a screen session named <strong>irc<\/strong>, You could:<\/p>\n<div class=\"codecolorer-container text blackboard\" style=\"overflow:auto;white-space:nowrap;width:565px;\"><div class=\"text codecolorer\">su - chris -c &quot;\/usr\/bin\/screen -dmS irc \/usr\/bin\/irssi&quot;<\/div><\/div>\n<p>You can then log in to the box as <strong>chris<\/strong> and resume the screen session that root started.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Came across this technique to get a screen session started as another non-root user on system startup. You could have this command in \/etc\/rc.local or any other location that runs on system startup as root. Also, it doesn&#8217;t have to just be at system startup. These commands could be used at any time by the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[],"class_list":["post-1477","post","type-post","status-publish","format-standard","hentry","category-Linux"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prpYG-nP","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts\/1477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/comments?post=1477"}],"version-history":[{"count":11,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts\/1477\/revisions"}],"predecessor-version":[{"id":1488,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts\/1477\/revisions\/1488"}],"wp:attachment":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/media?parent=1477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/categories?post=1477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/tags?post=1477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}