{"id":1925,"date":"2020-01-21T15:35:06","date_gmt":"2020-01-21T15:35:06","guid":{"rendered":"https:\/\/lamp.ciscoar.com\/?page_id=1925"},"modified":"2020-02-09T15:28:03","modified_gmt":"2020-02-09T15:28:03","slug":"telnet-vs-ssh","status":"publish","type":"page","link":"https:\/\/lamp.ciscoar.com\/?page_id=1925","title":{"rendered":"Telnet vs SSH"},"content":{"rendered":"\n\n\n<h2 class=\"wp-block-heading\">The history of SSH<\/h2>\n\n\n\n<p>The initial version of <strong>SSH <\/strong>(Secure Shell) was written in 1995 when <strong>telnet <\/strong>and <strong>FTP <\/strong>were widely used, you can learn a little bit more about how <a href=\"https:\/\/www.linkedin.com\/in\/tatuylonen\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Tatu Ylonen (opens in a new tab)\">Tatu Ylonen<\/a> a Finland student from de University of Helsinki wrote the first version of SSH and why the TCP port number 22 was chosen in <a rel=\"noreferrer noopener\" aria-label=\"this website (opens in a new tab)\" href=\"https:\/\/www.ssh.com\/ssh\/port\" target=\"_blank\">this website<\/a>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/ssh-secure-shell-first-version.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"790\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/ssh-secure-shell-first-version.jpg\" alt=\"\" class=\"wp-image-1930\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/ssh-secure-shell-first-version.jpg 719w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/ssh-secure-shell-first-version-273x300.jpg 273w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/a><figcaption>SSH initial proposal<\/figcaption><\/figure><\/div>\n\n\n\n<p>The main idea behind SSH was to allow secure connection from one computer into the other allowing people to work remotely.<\/p>\n\n\n\n<p>Working from home is nowadays something quite common between computers\/system administrators, you don&#8217;t want to spend much time working inside an ice cold Data Center, remote work is here to stay.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Open SSH<\/h2>\n\n\n\n<p>The first vesion of SSH evolved into Open SSH and now comes with every Unix, Linux, and Mac computer, but is also available for every other platform like MS Windows. It has become the de-facto tool for system and network administration over computer networks.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Checking Open SSH version on CentOS 7<\/h2>\n\n\n\n<p>Even though we&#8217;re working on LAB enviroment it is always a good idea to follow the security standards to be ready for the day when you move to the real life, I mean the moment when we move from the LAB to a VPS (Virtual Private Server).<\/p>\n\n\n<p class=\"fonts-plugin-block \" style=\"font-family: calibri;font-weight: 700;font-size: 20px;color: #9b51e0\">ssh -V<\/p>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/checking-ssh-version-centos7.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"163\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/checking-ssh-version-centos7.jpg\" alt=\"\" class=\"wp-image-1937\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/checking-ssh-version-centos7.jpg 498w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/checking-ssh-version-centos7-300x98.jpg 300w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Checking Open SSH current status<\/h2>\n\n\n\n<p>If for some reason you are not able to connect to your CentOS via SSH, the first troubleshooting step is to be sure there is connectivity between your devices, for that you can use &#8220;<a rel=\"noreferrer noopener\" aria-label=\"ping (opens in a new tab)\" href=\"\/lan-and-wan-connectivity\/\" target=\"_blank\">ping<\/a>&#8220;, and on the other hand, the second troubleshooting step will be to make sure that SSH is actually running, for that you can use the following CLI command:<\/p>\n\n\n<p class=\"fonts-plugin-block \" style=\"font-family: calibri;font-weight: 700;font-size: 20px;color: #9b51e0\">systemctl status sshd.service<\/p>\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/centos-ssh-status.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"500\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/centos-ssh-status.jpg\" alt=\"\" class=\"wp-image-1986\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/centos-ssh-status.jpg 763w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/centos-ssh-status-300x197.jpg 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Linux CentOS SSH files and folders<\/h2>\n\n\n\n<p>The image below shows a typical Linux directory tree and also where are located the important SSH files, one of them is used to configure SSH globally (<strong>sshd_config<\/strong>) and the others belongs to each user and each user uses this file to keep their SSH Public Keys (<strong>authorized_keys<\/strong>).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"599\" height=\"393\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/linux-centos-ssh-files-and-folders-involved.png\" alt=\"\" class=\"wp-image-2919\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/linux-centos-ssh-files-and-folders-involved.png 599w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/linux-centos-ssh-files-and-folders-involved-300x197.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><figcaption> <em>Linux CentOS SSH files<\/em><\/figcaption><\/figure>\n\n\n\n<p>As you can see in the image above the user &#8220;root&#8221; is not inside the famous &#8220;home&#8221; folder as the rest of the users of the system, I know this could be at the beginning a little bit confusing, the purpose really is to secure this account as much as possible, and make sure you don&#8217;t treat the &#8220;root&#8221; user as any other user.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SSH Global Settings file<\/h2>\n\n\n\n<p>All the settings related to SSH are located inside the file called &#8220;<strong>sshd_config<\/strong>&#8221; and because of that this is one of the most important SSH files, and the first place you want to go to learn how your SSH is currently configured and to tweak it to fit your own preferences, the image below shows the most important parameters you will find inside this vital SSH file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"268\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/sshd_config-global-parameters-1024x268.png\" alt=\"\" class=\"wp-image-1945\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/sshd_config-global-parameters-1024x268.png 1024w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/sshd_config-global-parameters-300x78.png 300w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/sshd_config-global-parameters-768x201.png 768w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/01\/sshd_config-global-parameters.png 1395w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Global SSH parameters<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Authorized Keys file<\/h2>\n\n\n\n<p>In order to enable the authentication via SSH Public\/Private keys, each user must have inside of its &#8220;<strong>home directory<\/strong>&#8221; a folder called &#8220;.<strong>ssh<\/strong>&#8221; and inside that folder a file called &#8220;<strong>authorized_keys<\/strong>&#8220;, all the public keys that are authorized to login into the machine must be there, you can simply copy and paste them immediately after they are created.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"399\" height=\"150\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/ssh_authorized_keys.png\" alt=\"\" class=\"wp-image-2596\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/ssh_authorized_keys.png 399w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2020\/02\/ssh_authorized_keys-300x113.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Where to go next?<\/h2>\n\n\n\n<p>Now that you know a little bit more about Open SSH we can move to the next step, we can generate a pair of SSH keys and you&#8217;ll see that it is a really quick process.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"\/ssh-key-generation-securecrt\/\">How to generate SSH Keys on SecureCRT<\/a><\/li><li><a href=\"\/ssh-key-generation-putty\/\">How to generate SSH Keys on Putty<\/a><\/li><li><a href=\"\/ssh-key-generation-winscp\/\">How to generate SSH Keys on WinSCP<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The history of SSH The initial version of SSH (Secure Shell) was written in 1995 when telnet and FTP were widely used, you can learn a little bit more about how Tatu Ylonen a Finland student from de University of Helsinki wrote the first version of SSH and why the TCP port number 22 was &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lamp.ciscoar.com\/?page_id=1925\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Telnet vs SSH&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1925","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/1925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1925"}],"version-history":[{"count":42,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/1925\/revisions"}],"predecessor-version":[{"id":3165,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/1925\/revisions\/3165"}],"wp:attachment":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}