{"id":399,"date":"2010-12-24T13:16:11","date_gmt":"2010-12-24T12:16:11","guid":{"rendered":"http:\/\/kudzia.eu\/b\/?p=399"},"modified":"2011-04-30T10:21:48","modified_gmt":"2011-04-30T09:21:48","slug":"chmod-gourwx-r","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2010\/12\/chmod-gourwx-r\/","title":{"rendered":"chmod gou+rwx -R \/ ?"},"content":{"rendered":"<p>once in a while i press enter too early. end result of changing permissions on the whole file system can be quite bad.<br \/>\n<!--more--><br \/>\ni&#8217;ve run<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nchmod gou+rwx -R \/ \r\n<\/pre>\n<p>and immediately ended up with server i cannot log into. <\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ntail -f \/var\/log\/auth.log\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: Permissions 0777 for '\/etc\/ssh\/ssh_host_rsa_key' are too open.\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: It is recommended that your private key files are NOT accessible by others.\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: This private key will be ignored.\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: bad permissions: ignore key: \/etc\/ssh\/ssh_host_rsa_key\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: Could not load host key: \/etc\/ssh\/ssh_host_rsa_key\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: Permissions 0777 for '\/etc\/ssh\/ssh_host_dsa_key' are too open.\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: It is recommended that your private key files are NOT accessible by others.\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: This private key will be ignored.\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: bad permissions: ignore key: \/etc\/ssh\/ssh_host_dsa_key\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: error: Could not load host key: \/etc\/ssh\/ssh_host_dsa_key\r\nDec 24 12:09:46 testSql1 sshd&#x5B;16291]: fatal: \/var\/run\/sshd must be owned by root and not group or world-writable.\r\n<\/pre>\n<p>but that&#8217;s just the beginning&#8230; system with such wide open perms will have couple services that just fail [like ssh] but also will be wildly insecure even if you manage to repair rights eg for ssh keys.<\/p>\n<p>fortunately there is simple way to fix it if you have access to another [similarly configured] server. first of all &#8211; do not log out from affected machine, unless you have console access [my machine was ~6000 km away and without kvm]. from server with destroyed permissions run:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ntestSql1:\/# ssh healthlyServer &quot;find \/ -printf 'chmod %m %p \\n'&quot;|\/bin\/bash\r\n<\/pre>\n<p>and &#8230; we&#8217;re back to the happy days. if you know about some differences in the directory structure &#8211; check it manually or restore them from the backup. reboot to make sure all gets up fine.<\/p>\n<p>[based on <a href=\"http:\/\/serverfault.com\/questions\/58277\/copy-permissions-to-identical-tree-on-linux-unix\/58291#58291\">this<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>once in a while i press enter too early. end result of changing permissions on the whole file system can be quite bad.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-399","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=399"}],"version-history":[{"count":5,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/399\/revisions"}],"predecessor-version":[{"id":570,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/399\/revisions\/570"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}