{"id":324,"date":"2013-11-17T11:01:25","date_gmt":"2013-11-17T10:01:25","guid":{"rendered":"http:\/\/joost.vunderink.net\/blog\/?p=324"},"modified":"2013-11-17T11:01:25","modified_gmt":"2013-11-17T10:01:25","slug":"giving-people-limited-shell-access-to-your-server","status":"publish","type":"post","link":"https:\/\/joost.vunderink.net\/blog\/2013\/11\/17\/giving-people-limited-shell-access-to-your-server\/","title":{"rendered":"Giving people limited shell access to your server"},"content":{"rendered":"<p>At work, I develop all kinds of backend software. We have a team of testers for high-level testing (in addition to the many unit-tests we have).<\/p>\n<p>At some point, I had written a Perl script that was going to run daily, from cron, processing some input and generating some output. Since our testers currently don&#8217;t have shell access to our development servers, the challenge was to find a simple way for them to test this script, with different inputs, and verifying that the output was correct.<\/p>\n<p>I looked around on the internet for a simple solution to this. I couldn&#8217;t find any. So I wrote a solution myself: <a title=\"WRATS\" href=\"https:\/\/github.com\/joostvunderink\/wrats\">WRATS &#8211; Web Restricted Access To Server<\/a>.<\/p>\n<p>With WRATS, you can allow people to perform the following actions via a browser:<\/p>\n<ul>\n<li>Read a file<\/li>\n<li>Edit a file<\/li>\n<li>Execute a file<\/li>\n<li>Browse a directory and read all files in that directory<\/li>\n<\/ul>\n<p>By default, all access is denied. You have to grant permission to each action on each item individually. For example, you can allow people to read the file <code>\/data\/input.txt<\/code> or edit the file <code>\/var\/www\/test\/status<\/code>.<\/p>\n<p>There is no authentication in WRATS. This is by design &#8211; adding pluggable authentication would have made it too complex and too much work. If you want to make sure WRATS can only be used by certain users, I suggest you use your web server to do that.<\/p>\n<p>WRATS has been designed with security in mind. For example, it is not possible to specify both edit rights and execute rights on a single file &#8211; that would make it possible to execute arbitrary code. Also, filenames passed by the user are strictly checked before any action is performed.<\/p>\n<p>WRATS allowed our testers to edit the input file, execute the script, and read the output file. They were happy, because they didn&#8217;t have to come to me anymore to ask me to run the script for them with the input they had emailed me just before, and I was happy, because of the same reason. And the rest of the team was happy, because WRATS can be used for other projects in the future as well.<\/p>\n<p>You can find WRATS on my <a title=\"Github - Joost Vunderink\" href=\"https:\/\/github.com\/joostvunderink\">github page<\/a>. I hope it&#8217;ll be useful to you one day!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At work, I develop all kinds of backend software. We have a team of testers for high-level testing (in addition to the many unit-tests we have). At some point, I had written a Perl script that was going to run &hellip; <a href=\"https:\/\/joost.vunderink.net\/blog\/2013\/11\/17\/giving-people-limited-shell-access-to-your-server\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[141,145,144,139,140,142,143,138],"class_list":["post-324","post","type-post","status-publish","format-standard","hentry","category-software-development","tag-access","tag-edit-file","tag-execute-file","tag-perl","tag-servera","tag-shell-access","tag-via-browser","tag-wrats"],"_links":{"self":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/324"}],"collection":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/comments?post=324"}],"version-history":[{"count":1,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/324\/revisions"}],"predecessor-version":[{"id":325,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/posts\/324\/revisions\/325"}],"wp:attachment":[{"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/media?parent=324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/categories?post=324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joost.vunderink.net\/blog\/wp-json\/wp\/v2\/tags?post=324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}