{"id":1480,"date":"2011-08-21T22:00:59","date_gmt":"2011-08-21T21:00:59","guid":{"rendered":"http:\/\/www.haydnwilliams.com\/blog\/?p=1480"},"modified":"2022-04-11T21:34:01","modified_gmt":"2022-04-11T20:34:01","slug":"uhs6-ssh-subversion-svn","status":"publish","type":"post","link":"https:\/\/www.haydnwilliams.com\/blog\/uhs6-ssh-subversion-svn\/","title":{"rendered":"UHS6 &#8211; SSH &#038; Subversion (SVN)"},"content":{"rendered":"<h2><span style=\"text-decoration: underline;\"><strong>SSH<\/strong><\/span><\/h2>\n<p><a title=\"Secure Shell on wikipedia.org\" href=\"http:\/\/en.wikipedia.org\/wiki\/Secure_Shell\" target=\"_blank\" rel=\"noopener\">SSH<\/a> lets you remotely access your computer, or other computers, using a command-line interface. Installing SSH really is a breeze:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo apt-get install ssh<\/pre>\n<p>It was so quick and easy I even had to check it had actually been done!<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">&gt;which ssh<\/pre>\n<p>The binary did exist and I was able to log into the machine without any problems. Almost too simple! You&#8217;ll probably want to increase the security of your setup a bit by using <strong>hosts.allow<\/strong> and <strong>hosts.deny<\/strong> files. These live in <strong>\/etc<\/strong> and consist of rules that determine which hosts should be allowed to connect to certain services on your machine. My <strong>hosts.deny<\/strong> has the following:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ALL: ALL<\/pre>\n<p>and my <strong>hosts.allow<\/strong> has this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">127.0.0.1\r\nSSHD: 192.168.1.23<\/pre>\n<p>This results in all connections from all IP addresses being denied, except for SSH from one specific machine on the local network. Note that the <strong>hosts.*<\/strong> files will only work on services started as daemons, not standalone, and these services must support <a title=\"TCP Wrappers on wikipedia.org\" href=\"http:\/\/en.wikipedia.org\/wiki\/Tcp_wrappers\" target=\"_blank\" rel=\"noopener\">TCP Wrappers<\/a> (which are what make <strong>hosts.*<\/strong> work). <a title=\"How to edit hosts deny and hosts allow - askubuntu.com\" href=\"http:\/\/askubuntu.com\/questions\/23163\/how-to-edit-hosts-deny-and-hosts-allow\" target=\"_blank\" rel=\"noopener\">This page<\/a>, and <a title=\"Using TCP Wrappers effectively\" href=\"http:\/\/itknowledgeexchange.techtarget.com\/linux-lotus-domino\/using-hostsallow-and-hostsdeny-aka-tcpwrappers-effectively\/\" target=\"_blank\" rel=\"noopener\">another,<\/a> revealed the following command to determine whether a particular daemon has support for TCP Wrappers; it basically checks whether the daemon depends on the relevant library, <strong>libwrap.so.0<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ldd \/usr\/sbin\/smbd | grep wrap<\/pre>\n<p>Running the above command doesn&#8217;t give any result, so <strong>smbd<\/strong> &#8211; the Samba server daemon &#8211; isn&#8217;t affected by <strong>hosts.*<\/strong> (see my other post for rudimentary details on securing Samba). There are plenty of pages which <a title=\"hosts.allow\" href=\"http:\/\/linux.about.com\/od\/commands\/l\/blcmdl5_hostsal.htm\" target=\"_blank\" rel=\"noopener\">delve<\/a> into more <a title=\"Using hosts to secure unix\" href=\"http:\/\/jamalahmed.wordpress.com\/2010\/03\/19\/using-etchosts-allow-and-etchosts-deny-to-secure-unix\/\" target=\"_blank\" rel=\"noopener\">detail<\/a> about more complex rules for <strong>hosts.*<\/strong>, or you could just:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">man hosts.allow\r\nman hosts.deny<\/pre>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"text-decoration: underline;\">Subversion<\/span><\/strong><\/h2>\n<p><a title=\"Apache Subversion\" href=\"http:\/\/subversion.apache.org\/\" target=\"_blank\" rel=\"noopener\">Subversion<\/a> (SVN) was no more difficult:<\/p>\n<p><code lang=\"bash\">sudo apt-get install subversion subversion-tools<\/code><\/p>\n<p>The first chance I got to test SVN as a client was when installing WordPress, which is covered in a different post. To test the server side of things, I just created a repository:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo svnadmin create \/var\/svn<\/pre>\n<p>Everything went swimmingly, so further setup will take place at a later date. There are a <a title=\"Subversion Cheat Sheet\" href=\"http:\/\/www.abbeyworkshop.com\/howto\/misc\/svn01\/\" target=\"_blank\" rel=\"noopener\">number<\/a> of <a title=\"How to Set up an SVN Repository in 7 Simple Steps\" href=\"http:\/\/civicactions.com\/blog\/2010\/may\/25\/how_set_svn_repository_7_simple_steps\" target=\"_blank\" rel=\"noopener\">good<\/a> <a title=\"Version Control with Subversion\" href=\"http:\/\/svnbook.red-bean.com\/en\/1.5\/index.html\" target=\"_blank\" rel=\"noopener\">guides<\/a> <a title=\"Subversion HowTo:\" href=\"http:\/\/queens.db.toronto.edu\/~nilesh\/linux\/subversion-howto\/\" target=\"_blank\" rel=\"noopener\">online<\/a> that will take you further with Subversion, which is beyond the scope of this post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH SSH lets you remotely access your computer, or other&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[680,681,682,640,515,510,323,326,662,679,604,661],"class_list":["post-1480","post","type-post","status-publish","format-standard","hentry","category-it","tag-hosts","tag-hosts-allow","tag-hosts-deny","tag-repository","tag-secure-shell","tag-ssh","tag-subversion","tag-svn","tag-svnssh","tag-tcp-wrappers","tag-ubuntu","tag-version-control"],"_links":{"self":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts\/1480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/comments?post=1480"}],"version-history":[{"count":0,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts\/1480\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/media?parent=1480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/categories?post=1480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/tags?post=1480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}