{"id":264,"date":"2009-05-20T21:40:47","date_gmt":"2009-05-21T00:40:47","guid":{"rendered":"http:\/\/wordpress.matbra.com\/?p=264"},"modified":"2010-07-25T02:21:26","modified_gmt":"2010-07-25T05:21:26","slug":"instalar-e-deixar-seu-servidor-ssh-mais-seguro","status":"publish","type":"post","link":"https:\/\/wordpress.matbra.com\/en\/2009\/05\/20\/instalar-e-deixar-seu-servidor-ssh-mais-seguro\/","title":{"rendered":"Install and configure SSH server to be safer."},"content":{"rendered":"<p>Good night, <\/p>\n<p>To install ssh server in Ubuntu use: <\/p>\n<blockquote><p>\n$ sudo apt-get install openssh-server\n<\/p><\/blockquote>\n<p>To let it safer edit \/etc\/ssh\/sshd_config<\/p>\n<blockquote><p>\n$ sudo vi \/etc\/ssh\/sshd_config\n<\/p><\/blockquote>\n<p>Than change the lines:<\/p>\n<blockquote><p>AllowUsers USER<br \/>\nAllowGroups GROUP_USER<br \/>\nPasswordAuthentication yes<br \/>\nMaxStartups 2:100:2<br \/>\nPort XXX # Change the port<\/p><\/blockquote>\n<p>What MaxStartups do? Specify the number of un authenticated connections in server. The syntax is start:percent:max. Example: 10:50:20. When it gets to 10 connections it will start with the percent. So every new connection will have 50% of chance to be automaticlly refused. When it gets to 20. It will denied ALL the new connections. <\/p>\n<p>If you want, you can ask for a second password, if you type it wrong, it will close the connection:<\/p>\n<p>Edit \/home\/user\/.profile<\/p>\n<blockquote><p>echo Put your password<br \/>\nread senha<br \/>\nif [ $senha == &#8220;SOMETHING&#8221; ]<br \/>\nthen<br \/>\n                        # CODES THAT ALREADY ARE AT .profile<br \/>\nelse<br \/>\nexit<br \/>\nfi<\/p><\/blockquote>\n<p>With this you can do some tricks, to create a new RANDOM password every time somebody connect and send it to your e-mail. So you will need to put your normal password, than access your e-mail account, verify the new password and type it. <\/p>\n<p>Best Regards,<br \/>\nMatheus<\/p>\n<p>References:<br \/>\n<a href=\"http:\/\/under-linux.org\/f43117-comando-su-2\" target=\"_blank\">Desabilitar Comando SU<\/a><br \/>\n<a href=\"http:\/\/opensolaris.org\/jive\/thread.jspa?messageID=248856\"  target=\"_blank\">Informa\u00e7\u00e3o MaxStartups<\/a><br \/>\n<\/p>","protected":false},"excerpt":{"rendered":"<p>Good night, To install ssh server in Ubuntu use: $ sudo apt-get install openssh-server To let it safer edit \/etc\/ssh\/sshd_config $ sudo vi \/etc\/ssh\/sshd_config Than&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/wordpress.matbra.com\/en\/2009\/05\/20\/instalar-e-deixar-seu-servidor-ssh-mais-seguro\/\">Continue reading<span class=\"screen-reader-text\">Install and configure SSH server to be safer.<\/span><\/a><\/div>\n","protected":false},"author":1,"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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34,104],"tags":[103,101,91,102,88],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-linux","category-shell-script","tag-openssh","tag-profile","tag-seguranca","tag-shell","tag-ssh","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/psjGE-4g","_links":{"self":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}