{"id":26417,"date":"2015-03-31T11:54:42","date_gmt":"2015-03-31T08:54:42","guid":{"rendered":"http:\/\/blog.superhosting.bg\/en\/?p=26417"},"modified":"2022-06-15T11:46:27","modified_gmt":"2022-06-15T08:46:27","slug":"first-look-at-ssh","status":"publish","type":"post","link":"https:\/\/blog.superhosting.bg\/en\/first-look-at-ssh.html","title":{"rendered":"First steps in Secure Shell (SSH)"},"content":{"rendered":"<p>\u200bDespite how scary the words &#8220;shell&#8221; and &#8220;computer terminal&#8221; may sound, they are actually not so intimidating when one knows their meaning and purpose.<\/p>\n<p>For Linux fans, working with a terminal or using commands in the shell for system management and setup is something ordinary and does not pose any challenges. But for those who have never used the black window the idea for writing commands instead of clicking on icons looks quite tedious and incomprehensible.<!--more--><\/p>\n<p><strong>SSH<\/strong> stands for two words \u2013 <strong>secure<\/strong> and <strong>shell.<\/strong> We will skip the explanation of secure, but will talk a bit about what a <strong>shell<\/strong> is.<\/p>\n<h2 id=\"boxheadlinefs15p5mb12eee\">What is Shell?<\/h2>\n<p>In computing, <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Shell_(computing)\" target=\"_blank\" rel=\"noopener noreferrer\">shell<\/a><\/strong> is a program which plays the role of a translator between the user and the operating system. The shell provides an interface though which the user can enter commands to run and use the services of the operation system.<\/p>\n<p>There are two types of shell:<\/p>\n<ul>\n<li>Text shell \u2013 with command line interface (<strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Command-line_interface\" target=\"_blank\" rel=\"noopener noreferrer\">CLI<\/a><\/strong>)<\/li>\n<li>Graphical shell \u2013 with graphical user interface (<strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Graphical_user_interface\" target=\"_blank\" rel=\"noopener noreferrer\">GUI<\/a><\/strong>).<\/li>\n<\/ul>\n<p>With text shells the user issues commands to the program in the form of successive lines of text in a special window (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Terminal_emulator\" target=\"_blank\" rel=\"noopener noreferrer\">terminal<\/a>). With graphic shells the user does not need to know or type any commands. Instead, he interacts with the operating system by means of graphical icons and visual indicators.<\/p>\n<p>In most of the Linux-based systems the default text shell is <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Bash_(Unix_shell)\" target=\"_blank\" rel=\"noopener noreferrer\">bash<\/a><\/strong> (Bourne-again shell), but there are also other shells such as ksh, tcsh and zsh. <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cmd.exe\" target=\"_blank\" rel=\"noopener noreferrer\">cmd.exe<\/a> (Command Prompt) and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Windows_PowerShell\" target=\"_blank\" rel=\"noopener noreferrer\">Windows PowerShell<\/a> are the most commonly used text shells for Windows-based systems.<\/p>\n<table style=\"border: 0px; vertical-align: top; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"border: 0px; background-color: #ffffff; vertical-align: top; padding: 0px;\">\n<p><figure id=\"attachment_23585\" aria-describedby=\"caption-attachment-23585\" style=\"width: 250px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-23585 size-full\" src=\"\/wp-content\/uploads\/2015\/03\/ssh-command-line-shell-windows-linux.png\" alt=\"\u0422\u0435\u043a\u0441\u0442\u043e\u0432 \u0448\u0435\u043b \u043f\u0440\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0438\" width=\"250\" height=\"302\" \/><figcaption id=\"caption-attachment-23585\" class=\"wp-caption-text\">Text shell\u00a0(CLI)\u00a0<\/figcaption><\/figure><\/td>\n<td style=\"border: 0px; background-color: #ffffff; vertical-align: top; padding: 0px;\">\n<p><figure id=\"attachment_23586\" aria-describedby=\"caption-attachment-23586\" style=\"width: 250px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-23586 size-full\" src=\"\/wp-content\/uploads\/2015\/03\/ssh-graphic-shell-windows-linux.png\" alt=\"\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u043d \u0448\u0435\u043b \u043f\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 Windows\" width=\"250\" height=\"302\" \/><figcaption id=\"caption-attachment-23586\" class=\"wp-caption-text\">Graphical shell\u00a0(GUI) on\u00a0MS Windows<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"boxheadlinefs15p5mb12eee\">What is Secure Shell (SSH)?<\/h2>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Secure_Shell\" target=\"_blank\" rel=\"noopener noreferrer\">SSH<\/a> (Secure Shell) is a network protocol, used to enable secure access and connection to the shell of a remote machine. The SSH connection between the two applications, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comparison_of_SSH_servers\" target=\"_blank\" rel=\"noopener noreferrer\">SSH server<\/a> and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comparison_of_SSH_clients\" target=\"_blank\" rel=\"noopener noreferrer\">SSH client<\/a>, is encrypted. This provides high level of security for the data transferred.<\/p>\n<p>SSH protocol was designed in 1995 by Tatu Yl\u00f6nen at the Helsinki University of Technology, Finland. The reason for creating the protocol was to secure the university network which had to face a password-sniffing attack earlier in the same year.<\/p>\n<p>Quickly after its appearance SSH replaced the unsecured network protocols such as telnet, rlogin, rsh, rcp that had been used until then. The last released and widely used protocol version is SSH-2.<\/p>\n<p>SSH is the most popular method for accessing Linux-based servers, just like the virtual servers (<a href=\"https:\/\/www.superhosting.bg\/web-hosting-page-servers-vps.php\">VPS<\/a>).<\/p>\n<p>Except for remote management and executing commands, SSH can be used for file transfer via the <a href=\"https:\/\/help.superhosting.bg\/sftp.html\" target=\"_blank\" rel=\"noopener noreferrer\">SFTP<\/a> (SSH File Transfer Protocol) or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Secure_copy\" target=\"_blank\" rel=\"noopener noreferrer\">SCP<\/a> (Secure copy) protocols.<\/p>\n<h2 id=\"boxheadlinefs15p5mb12eee\">What can you do with SSH?<\/h2>\n<p>The text shell offers better opportunities for more precise management and configuration than the graphic interface. This is due to the fact that not all commands and actions in the system can be present in the graphic interface.<\/p>\n<p>The shell is mainly used by sysadmins for system configuration and management. As we already mentioned, not all of the commands are available in the graphical control panel. For that reason the text shell remains the main tool for full control and system management.<\/p>\n<p>Here are a few of the actions you can perform when you have SSH access:<\/p>\n<ul>\n<li><em>Using <\/em><strong><em>Git client in the hosting account<\/em><\/strong><\/li>\n<li><strong><em>Working with MySQL databases<\/em><\/strong><\/li>\n<li><em>CMS management \u2013 <\/em><strong><em>WordPress<\/em><\/strong><em>, <\/em><strong><em>Drupal<\/em><\/strong><\/li>\n<li><em>Checking the running <\/em><strong><em>processes<\/em><\/strong><\/li>\n<li><em>Compression and archiving of files and directories\u00a0<\/em><\/li>\n<\/ul>\n<div id=\"boxcolorp5mb12red\"><strong>Important:<\/strong> The <a href=\"https:\/\/en.superhosting.bg\/web-hosting-page-servers-vps.php\" target=\"_blank\" rel=\"noopener noreferrer\">VPS<\/a> and <a href=\"https:\/\/en.superhosting.bg\/web-hosting-page-servers-vps.php\" target=\"_blank\" rel=\"noopener noreferrer\">CloudVPS<\/a> services provide you with the <strong>root<\/strong> user. The root gives you full access to the shell for server management purposes and, besides the above mentioned actions, you can also install and configure server applications, change any system settings, and many more.<br \/>\nIf SSH access to the <a href=\"https:\/\/en.superhosting.bg\/web-hosting-compare-hosting-plans.php\" target=\"_blank\" rel=\"noopener noreferrer\">shared hosting account<\/a> is required, the cPanel user is used as this is not the main admin system user.<\/div>\n<h2 id=\"boxheadlinefs15p5mb12eee\">What are the existing SSH clients?<\/h2>\n<p>You can choose between different software solutions or SSH clients in accordance with the operating system you are using on your computer.<\/p>\n<p>Normally, Linux users can directly go through the system terminal to connect with a remote server via SSH. For example by using the command:<\/p>\n<p>ssh user@vps-ip-address -p vps-port<\/p>\n<p>Windows users, however, will need to additionally install a SSH client application. One of the most popular SSH clients for Windows is <a href=\"https:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">PuTTY<\/a>. If you need to access more than one server via SSH, you can use tabs for the different SSH sessions (try <a href=\"http:\/\/ttyplus.com\/multi-tabbed-putty\" target=\"_blank\" rel=\"noopener noreferrer\">MTPuTTY<\/a>).<\/p>\n<h2 id=\"boxheadlinefs15p5mb12eee\">\u200bFirst encounter with the terminal<\/h2>\n<p>We highly recommend you not to fear the unknown and just give it a try! All of the commands you can use in the terminal can be found online, for example on the <a href=\"http:\/\/archive.oreilly.com\/linux\/cmd\" target=\"_blank\" rel=\"noopener noreferrer\">Linux commands<\/a> website.<\/p>\n<p>Here are a few simple commands which might help you get oriented in the scary black window:<\/p>\n<p style=\"padding-left: 30px;\"><strong>pwd<\/strong><br \/>\n(shows your current directory)<br \/>\nYou might easily get lost while working with the terminal and changing directories too often. With this command you will display the name and full path to the directory you are working in.<\/p>\n<p style=\"padding-left: 30px;\"><strong>ls -al<\/strong><br \/>\n(shows the current directory content)<br \/>\nThis command is similar to the dir command in MS-DOS. The -l and -a options are added to ls as with them the list will contain further information and will display file names beginning with a dot (&#8220;.&#8221;).<\/p>\n<p style=\"padding-left: 30px;\"><strong>mkdir<\/strong><br \/>\n(creating a new directory)<br \/>\nYou can create a new directory with this command. For example, mkdir name_of_the_directory will create e new directory, named name_of_the_directory.<\/p>\n<div id=\"boxcolorp5mb12ye\"><strong>Tip from the Support: <\/strong>SSH access to the hosting account or virtual server is one of the most secure connections possible (compared to FTP and web access). For even bigger security we recommend <strong>that you access your hosting account using SSH key<\/strong>.<\/div>\n<div id=\"boxcolorp5mb12blue\">\n<p><strong>Fun fact:<\/strong> Google also has a shell \u2013 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Google_Shell\" target=\"_blank\" rel=\"noopener noreferrer\">Google Shell<\/a> or <strong><a href=\"http:\/\/www.goosh.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">goosh<\/a><\/strong>: <a href=\"http:\/\/www.goosh.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.goosh.org<\/a>.\u00a0Goosh accepts user commands and displays the results in the window. It might be used for a super fast search in Google, Wikipedia, etc. This shell works in the Google Chrome browser. You can start a search as you directly type a word in the address bar, after the domain, for example <a href=\"http:\/\/goosh.org\/#shell\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/goosh.org\/<strong>#shell<\/strong><\/a> will display the first four results for shell.<\/p>\n<\/div>\n<div id=\"boxcolorp5mb12blue\"><strong>Fun fact:<\/strong> Here is <a href=\"https:\/\/nmap.org\/movies\/\" target=\"_blank\" rel=\"noopener noreferrer\">a command<\/a> that has been used in several famous movies such as &#8220;The Matrix: Reloaded&#8221;, &#8220;Die Hard 4&#8221;, &#8220;The Bourne Ultimatum&#8221;, &#8220;Elysium&#8221;, etc.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>For Linux fans, working with a terminal or using commands in the shell for system management and setup is something ordinary and does not pose any challenges.<\/p>\n","protected":false},"author":16,"featured_media":62197,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[118],"tags":[],"class_list":{"0":"post-26417","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-superhosting-tips-of-support-en"},"aioseo_notices":[],"modified_by":"\u041c\u0430\u0434\u043b\u0435\u043d\u0430 \u041c\u0435\u0442\u043e\u0434\u0438\u0435\u0432\u0430","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/comments?post=26417"}],"version-history":[{"count":22,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26417\/revisions"}],"predecessor-version":[{"id":66686,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/posts\/26417\/revisions\/66686"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media\/62197"}],"wp:attachment":[{"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/media?parent=26417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/categories?post=26417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.superhosting.bg\/en\/wp-json\/wp\/v2\/tags?post=26417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}