{"id":506,"date":"2012-11-11T23:02:57","date_gmt":"2012-11-11T23:02:57","guid":{"rendered":"http:\/\/cyber-cottage.co.uk\/en\/?p=506"},"modified":"2012-11-11T23:02:57","modified_gmt":"2012-11-11T23:02:57","slug":"trusting-linux-servers","status":"publish","type":"post","link":"https:\/\/www.cyber-cottage.co.uk\/?p=506","title":{"rendered":"Trusting Linux servers"},"content":{"rendered":"<p>This hopes to explain in simple steps setting up a pair (or more) servers as a trusted group.<br \/>\nSo what do we want to achieve ? Well we wnat to be able to ssh, sftp, rsync etc between servers and not\u00a0need to enter passwords<br \/>\nSteps required<br \/>\n1 Hosts File<br \/>\n2 Editing sshd_config<br \/>\n3 Create the ssh keys<br \/>\n4 Setting up the Auth. users file<br \/>\n<strong>Hosts File<\/strong><\/p>\n<p>Firstly we need to make sure all servers are in the hosts file<br \/>\n# Do not remove the following line, or various programs<br \/>\n# that require network functionality will fail.<br \/>\n127.0.0.1 localhost<br \/>\n127.0.0.1 asterisk2.local<br \/>\n# We point to eth0 on our own box<br \/>\n192.168.10.100 asterisk2.local<br \/>\n192.168.10.100 asterisk2<br \/>\n# We point to eth1 on the other box<br \/>\n192.168.10.108 asterisk1<\/p>\n<p><strong>Editing sshd_config<\/strong><\/p>\n<p>Now we need to edit the \/etc\/ssh\/sshd_config file<br \/>\nso that the following<\/p>\n<p>RSAAuthentication yes<br \/>\nPubkeyAuthentication yes<br \/>\nAuthorizedKeysFile \/root\/.ssh\/authorized_keys<\/p>\n<p>replaces<\/p>\n<p>#RSAAuthentication yes<br \/>\n#PubkeyAuthentication yes<br \/>\n#AuthorizedKeysFile .ssh\/authorized_keys<\/p>\n<p>Now restart the sshd<br \/>\n\/etc\/init.d\/sshd restart<\/p>\n<p><strong>Create the ssh keys<\/strong><\/p>\n<p>We now need to create the keys on each server<br \/>\nssh-keygen -t rsa<br \/>\nand hit return for all the questions.<br \/>\nthis will create 2 files in \/root\/.ssh<\/p>\n<p>go the \/root\/.ssh directory and copy the id_rsa.pub to the other server and get its id_rsa.pub<\/p>\n<p>sftp asterisk1<\/p>\n<p>put id_rsa.pub asterisk2.pub<br \/>\nget id_rsa.pub asterisk1.pub<br \/>\nbye<\/p>\n<p><strong>Setting up the Auth. users file<\/strong><\/p>\n<p>In the \/root\/.ssh directory you will now have for example :-<\/p>\n<p>asterisk1.pub id_rsa id_rsa.pub known_hosts<\/p>\n<p>We now need to copy the asterisk1.pub to the authorized_keys file<\/p>\n<p>cat asterisk1.pub &gt;&gt; authorized_keys<\/p>\n<p>Do the same on the other server.<\/p>\n<p>You should now be able to ssh and rsync between servers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This hopes to explain in simple steps setting up a pair (or more) servers as a trusted group. So what do we want to achieve ? Well we wnat to be able to ssh, sftp, rsync etc between servers and not\u00a0need to enter passwords Steps required 1 Hosts File 2 Editing sshd_config 3 Create the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"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":[11],"tags":[23,51,73,100],"class_list":["post-506","post","type-post","status-publish","format-standard","hentry","category-knowledge","tag-asterisk","tag-linux","tag-support","tag-technical"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5daZy-8a","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=506"}],"version-history":[{"count":0,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/506\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyber-cottage.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}