{"id":2526,"date":"2011-09-28T03:03:15","date_gmt":"2011-09-28T07:03:15","guid":{"rendered":"https:\/\/webhostinggeeks.com\/blog\/?p=2526"},"modified":"2021-10-19T06:48:20","modified_gmt":"2021-10-19T10:48:20","slug":"connect-to-your-server-using-ssh","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/blog\/connect-to-your-server-using-ssh\/","title":{"rendered":"How To Connect To Your Server Using SSH"},"content":{"rendered":"<p>SSH is about as cool as sliced bread, if maybe not a little bit more so. Seriously, it\u2019s a great way to get at your server\u2019s terminal shell, which\u2014as we all know\u2014is the hotbed of power. From there you can change just about any aspect of the server, not to mention seriously screw things up if you don\u2019t know what you\u2019re doing.<\/p>\n<p><em>&#8220;Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network: a server and a client (running SSH server and SSH client programs, respectively) &mdash; <a href=\"https:\/\/en.wikipedia.org\/wiki\/Secure_Shell\" target=\"_blank\" rel=\"noopener\">https:\/\/en.wikipedia.org\/wiki\/Secure_Shell<\/a>.&#8221;<\/em><\/p>\n<p>Regardless of your skill level or knowledgeability, if you\u2019re going to do any serious web mastering with your server, you\u2019ll need to access the server shell at some point. To do this, you\u2019ll need to tunnel commands server-side via SSH. There are several ways to accomplish this, but each operating system treats the process slightly differently. Lucky for you, we\u2019ve got a common way to get at your server via SSH for all three major operating systems. No need to thank us, though: This is by no means a comprehensive methods list, but rather just a quick guide to dipping your toe in the water. For more complex entry methods, hit up the Big-G and google it.<\/p>\n<p style=\"text-align: left\">In the meantime, though, check below for our ways of getting to your server via SSH!<\/p>\n<h3>SSH Access For Windows<\/h3>\n<p>Windows is complicated, and because of that, we\u2019ll get it out of the way quick. Windows, unlike Linux or Macintosh (which we\u2019ll look at in just a second) is not based on UNIX, and does not come stock with any kind of SSH client. However, there are plenty of utilities out there that will get the job done. Without sending you to a search engine, though, you can use our favorite in the meantime: <a href=\"https:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noopener\">PuTTY<\/a>.<\/p>\n<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/putty_ssh.png\" alt=\"putty ssh\" title=\"putty ssh\" width=\"456\" height=\"439\" class=\"alignnone size-full wp-image-4160 lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/putty_ssh.png 456w, https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/putty_ssh-128x123.png 128w, https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/putty_ssh-420x404.png 420w\" data-sizes=\"(max-width: 456px) 100vw, 456px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 456px; --smush-placeholder-aspect-ratio: 456\/439;\" \/><\/p>\n<p>This handy application provides a pleasant enough graphical interface from which to get at your server. Just enter the name of the host, then choose SSH as your connection type. If you\u2019d like, you can save the information for further use. Then enter your username and password, and PuTTY should do the rest.<\/p>\n<p>Download PuTTY at <a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html<\/a>.<\/p>\n<h3>For Linux<\/h3>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Linux\" target=\"_blank\" rel=\"noopener\">Linux<\/a>, by nature of its internal coding, is much less of a pain in the derriere. All you have to do is locate your local terminal application (this varies from distro to distro, so look carefully) and then type the following string:<\/p>\n<p>[code lang=&#8221;shell&#8221;]<br \/>\nssh -l your-username yourserver-or-ip.com<br \/>\n[\/code]<\/p>\n<h3>For Macintosh<\/h3>\n<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/ssh-mac-terminal.jpg\" alt=\"ssh mac terminal\" title=\"ssh mac terminal\" width=\"529\" height=\"302\" class=\"alignnone size-full wp-image-4163 lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/ssh-mac-terminal.jpg 529w, https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/ssh-mac-terminal-128x73.jpg 128w, https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/ssh-mac-terminal-420x240.jpg 420w, https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/ssh-mac-terminal-372x212.jpg 372w, https:\/\/webhostinggeeks.com\/blog\/wp-content\/uploads\/2011\/09\/ssh-mac-terminal-328x187.jpg 328w\" data-sizes=\"(max-width: 529px) 100vw, 529px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 529px; --smush-placeholder-aspect-ratio: 529\/302;\" \/><\/p>\n<p>For <a href=\"https:\/\/www.apple.com\/mac\/\" target=\"_blank\" rel=\"noopener\">Mac<\/a> users, enter the same command as above, only use the native Terminal application, which can be found in your Utilities folder. Easy as pie, right?<\/p>\n<h3>Basic SSH Commands<\/h3>\n<p>Here is a short list of some of the most common SSH commands.<\/p>\n<p>[code lang=&#8221;shell&#8221;]<br \/>\n&lt;command&gt; -h                 # The -h flag provides help on a command<br \/>\nls                           # List the contents of the current directory<br \/>\ncd &lt;directory or full path&gt;  # Change to that directory or path<br \/>\ncp &lt;source&gt; &lt;destination&gt;    # Copy the source file to the destination<br \/>\ncp -r &lt;source&gt; &lt;destination&gt; # Copy the source directory to the destination directory<br \/>\nmv &lt;source&gt; &lt;destination&gt;    # Move the source file to the destination<br \/>\nmkdir &lt;directory name&gt;       # Create a new directory<br \/>\npico &lt;file&gt;                  # Edit file in a friendly, easy to use file editor<br \/>\ngrep &lt;text&gt; &lt;file&gt;           # Search for text within a file<br \/>\nwget &lt;URI&gt;                   # Download the file at the given URI to the current path<br \/>\ntar -xz -f &lt;file&gt;            # Un-gzip and un-tar the given *.tgz or *.tar.gz file<br \/>\nrm &lt;file&gt;                    # Delete the file<br \/>\nrm -r &lt;directory&gt;            # Delete the directory and all contents<br \/>\nkillall &lt;program name&gt;       # Kill all running processes of the program<br \/>\nps                           # Show running processes<br \/>\ntop                          # Show running processes in a graphical frontend<br \/>\nnetstat                      # Show all current network connections<br \/>\ndu                           # Show disk usage<br \/>\n[\/code]<\/p>\n<p>For more SSH commands check <a href=\"https:\/\/twitter.com\/#!\/david_coe\" target=\"_blank\" rel=\"noopener\">David Coe<\/a>&#8216;s <a href=\"https:\/\/www.sshcommands.co.uk\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.sshcommands.co.uk\/<\/a>, an easy to understand list of SSH commands (with examples).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH is about as cool as sliced bread, if maybe not a little bit more so. Seriously, it\u2019s a great way to get at your server\u2019s terminal shell, which\u2014as we&#8230;<\/p>\n","protected":false},"author":58,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[9,2601],"tags":[648,210],"class_list":["post-2526","post","type-post","status-publish","format-standard","hentry","category-security-issues","category-webmaster-resources","tag-ssh","tag-web-server"],"views":104,"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/posts\/2526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/comments?post=2526"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/posts\/2526\/revisions"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/media?parent=2526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/categories?post=2526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/blog\/wp-json\/wp\/v2\/tags?post=2526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}