SSH Tutorial - Basic server administration with SSH

LearnCode.academy · Beginner ·☁️ DevOps & Cloud ·12y ago
Skills: Linux & CLI80%

Key Takeaways

This video tutorial covers the basics of SSH and server administration, including how to securely connect to a remote machine and configure it.

Full Transcript

hey there so in some upcoming videos I'm going to be showing some node server Administration we're going to set up an engine X load balancer um we're going to deploy some nodejs applications into the wild uh but to do that you got to be comfortable with SSH um and so this video is going to kind of cover that if you're comfortable with SSH this video is not really for you uh but a lot of devs have not really gone further than GitHub when it comes to SSH so this video is going to get into it and show you how fun and uh just powerful it is so basically SSH just opens up a secure shell to another machine usually it's going to be a Linux machine uh and it just basically gets you into the terminal of that machine so I can go SSH will which is my username at um superc cars.com which is a fake uh machine but uh that I've created but basically superc cars.com is going to point to an IP address of an actual real machine sitting somewhere uh so if I SSH into that I'm basically logging into that machine as the will User it's going to ask for my password um and there you go I'm now will at supercars so I'm actually on that machine um logged into the will user directory uh so I can do everything on this machine just as if I was actually there um I can install things let's say git is not currently installed so I can do pseudo appg install get um apt git is basically linux's npm or node package manager or Homebrew it allows you to install programs from the command line um so I can just do this and now get is installed so I can now let me find a gist I can now get clone there you go I can now clone a gist that I wrote the other day and there we go I have uh get repository on my machine so it's actually great for deployments if you want to clone your directory and pull your master branch and this is your actual web server there you go let's say you want to install MySQL PHP whatever uh you're on the machine you can configure and administrate your machine um all through SSH it's really great um you can also copy files um using rsync so let me show you what I have here I exited by the way exit is the command to get out of you'll notice when I hit exit I left that machine and I'm back on my machine now which has my kind of custom bash script here um so you can use rsync let me show you I have these three files in my directory um and I can rsync uh- AV is the one and by the way all these commands I'm going to put them in a gist uh and put it in the description so I don't just show you a bunch of stuff and then leave you hanging but I can rsync AV dot is my current directory so I'm going to do all the files in this directory will atup cars.com and then colon because I'm going to actually give it a path to do that I'm going to go home directory slne app it's going to ask for my password that's kind of annoying I'm going to show you how to do password list um SSH here in a second but you see I created the directory home will new app and I copied all these files there let's actually ssh in and see if that did it and need's my password again there we go we have new app so I can go CD space new app and do directory listing and there you go there's my files so that's kind of actually a quick and dirty way to do it a deployment if you want to you can just rsync all your files straight to your server and now your web server is updated with your new files it sure beats FTP it's pretty dirty it'd be better to actually do push it to a GitHub repo log in and do a poll from that repo or even better use a deployment software like Capistrano which we'll get into in the future uh in some videos there's definitely better deployment strategy but R sync sure beats uh FTP um let me actually RM I'm going to delete main.css here let's get out and I'm going to rsync again and then you'll notice all it did was copy main.css because rsync is actually going to sync up it's going to find out what it needs to do it's only going to move the files it needs to move the files that were changed once again super beats FTP so if you're looking for a quick and dirty deployment there you go uh just rsync that thing uh but we'll get into better things later on let's show you real quick how to do a password list SSH uh you probably had to do this when you got setup on GitHub is you had to make an SSH key um what a key pair is is you've got your public key and you've got your private key when you generate it it will create both like say you Cate create a key called ID RSA which is standard um it's going to do ID RSA which is your private key and it's going to do ID RSA Pub you're going to copy the contents of this to the server and the pub and you're going to move it to the authorized Keys file and then the server knows that this ID RSA key is accepted in place of a password so this is the one you want to protect with your life uh because anybody with this file can access your server that has this file installed so what we're going to do is we're going to install this right here onto our server and then anytime we have this key we can connect without a password uh so to do that we just go to our user folder and go to SSH directory if that's not there you're going to have to create it um and then whoops I just made one called SSH without the dot so you're going to make a directory called SSH which it says um it's already there so um and then if you don't see an ID RSA file which I just deleted mine you're going to want to generate one that's easy SSH key gen and then the only thing you're going to want to do is capital c and you're going to want to give it a comment that kind of differentiates it to you usually just do your email address there we go um and then it's going to say you want to make it this file ID RSA sure hit enter uh passphrase I'm going to do no passphrase so if I hit LS now I have ID RSA and IDs a.ub you're going to open this and you're going to copy the contents to your clipboard or if you want to do it the quick way you can go cat ID rs. Pub pipe PB copy so I'm going to copy that to my clipboard and now I'm going to SSH will at superc cars.com again I'm getting tired of type in my password so now we are going to go into my SSH folder it doesn't exist so I'm going to actually make it and then I'm going to get into it and I'm going to use Nano which is kind of like a command line text editor there's Nano emac and Vim which are kind of the three popular ones my favorite is vim although it's the most complicated uh Nano is the easiest so if you're not used to it use Nano I'm going to Nano a file called authorized unor Keys uh which it may already exist if it already exists this will open it if it doesn't exist Nano will create it I can now paste in my key Contents I can exit and I can save um which by the way let me show you what I was doing here I did crl X to exit one thing that's nice about Nano is it gives you like kind of a menu at the bottom uh crl X and then y to save and it says hit enter yep so now if I hit LS I have a file called authorized keys and in that is my ID RSA Pub you can add 30 different keys if you want so 30 different people can all s H into your uh machine without a password I can now hit exit and now let me go back to my folder that I was in code sandbox I think it was just SSH there we go so now let me pull up that rsync command again there we go and now it does not ask for a password I can also go SSH will at superc cars.com and it didn't ask for a password so now I can create Like A bash script that did 50 different things on my server and it wouldn't need a password for it I could run one command that runs the script and it does this whole server script so when you've seen bash scripting that's pretty much a lot of times along the lines of the things you're looking at doing uh but that's pretty much ssh in a nutshell it allows you to securely connect to another server run some commands on it administrate that server um and in the next video we're going to show you how to create your own Linux server on your machine using vagrant uh and virtual box and so you can mess with and get to know server Administration better without blowing up your actual live web server or someone else's live web server so let's get into that next video which is on vagrant

Original Description

If you want to level up your web dev skills, Linux server administration is a great place to start...and it's NOT HARD! It all begins by knowing how to SSH (Secure Shell) into a remote machine and configure it. If you have never done that, then here we go, you're about to find out that that infinite-black-box of server administration isn't so bad after all. Here's a Gist of all the commands I'll be running here: https://gist.github.com/learncodeacademy/5850f394342a5bfdbfa4 We're going to start by making an SSH connection to our server. Once we do that, we can install git with one command (and anything else you want to install), and get to work configuring our linux box to be a web server. -~-~~-~~~-~~-~- Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device" https://www.youtube.com/watch?v=fgOO9YUFlGI -~-~~-~~~-~~-~-
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from LearnCode.academy · LearnCode.academy · 34 of 60

1 Web Development Tutorial for Beginners (#1) - How to build webpages with HTML, CSS, Javascript
Web Development Tutorial for Beginners (#1) - How to build webpages with HTML, CSS, Javascript
LearnCode.academy
2 Web Development Tutorial for Beginners (#2) - Basic CSS - How to build a website with HTML & CSS
Web Development Tutorial for Beginners (#2) - Basic CSS - How to build a website with HTML & CSS
LearnCode.academy
3 How to create CSS Layouts - Web Development Tutorial for Beginners (#3) - with HTML & CSS
How to create CSS Layouts - Web Development Tutorial for Beginners (#3) - with HTML & CSS
LearnCode.academy
4 Bootstrap Tutorial For Beginners - Responsive Design with Bootstrap 3 - Responsive HTML, CSS
Bootstrap Tutorial For Beginners - Responsive Design with Bootstrap 3 - Responsive HTML, CSS
LearnCode.academy
5 Angularjs Tutorial for Beginners - learn Angular.js using UI-Router
Angularjs Tutorial for Beginners - learn Angular.js using UI-Router
LearnCode.academy
6 CSS Tutorial - Web Development Tutorial for Beginners (#5)
CSS Tutorial - Web Development Tutorial for Beginners (#5)
LearnCode.academy
7 Node.js tutorial for beginners - an introduction to Node.js with Express.js
Node.js tutorial for beginners - an introduction to Node.js with Express.js
LearnCode.academy
8 Github Tutorial For Beginners - Github Basics for Mac or Windows & Source Control Basics
Github Tutorial For Beginners - Github Basics for Mac or Windows & Source Control Basics
LearnCode.academy
9 Javascript Tutorial - Programming Tutorial for Beginners Pt 1
Javascript Tutorial - Programming Tutorial for Beginners Pt 1
LearnCode.academy
10 Javascript Tutorial - jQuery Tutorial for Beginners Pt 2
Javascript Tutorial - jQuery Tutorial for Beginners Pt 2
LearnCode.academy
11 AngularJS Directives Tutorial - Part 1 - Demystifying Angular Directives
AngularJS Directives Tutorial - Part 1 - Demystifying Angular Directives
LearnCode.academy
12 WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice
WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice
LearnCode.academy
13 YEOMAN TUTORIAL - Master Front-End Workflow with Yeoman, Grunt and Bower
YEOMAN TUTORIAL - Master Front-End Workflow with Yeoman, Grunt and Bower
LearnCode.academy
14 BOWER! - Streamline Web Workflow with Bower Package Manager
BOWER! - Streamline Web Workflow with Bower Package Manager
LearnCode.academy
15 Chrome DevTools for CSS - Better CSS Coding & CSS Debugging with Developer Tools
Chrome DevTools for CSS - Better CSS Coding & CSS Debugging with Developer Tools
LearnCode.academy
16 GITHUB ATOM - Why Atom.io will be your favorite Text Editor!
GITHUB ATOM - Why Atom.io will be your favorite Text Editor!
LearnCode.academy
17 GITHUB PULL REQUEST, Branching, Merging & Team Workflow
GITHUB PULL REQUEST, Branching, Merging & Team Workflow
LearnCode.academy
18 Pimp that Terminal - Add shortcuts and functions to your .bash_profile to simplify routine tasks
Pimp that Terminal - Add shortcuts and functions to your .bash_profile to simplify routine tasks
LearnCode.academy
19 jQuery Tutorial #3 - Writing Smarter, Better Code - jQuery Tutorial for Beginners
jQuery Tutorial #3 - Writing Smarter, Better Code - jQuery Tutorial for Beginners
LearnCode.academy
20 jQuery Tutorial #2 - Event Binding - jQuery Tutorial for Beginners
jQuery Tutorial #2 - Event Binding - jQuery Tutorial for Beginners
LearnCode.academy
21 jQuery Tutorial #1 - jQuery Tutorial for Beginners
jQuery Tutorial #1 - jQuery Tutorial for Beginners
LearnCode.academy
22 Node.js MongoDB Tutorial using Mongoose
Node.js MongoDB Tutorial using Mongoose
LearnCode.academy
23 Node.js tutorial for beginners 2014 - an introduction to Node.js with Express.js
Node.js tutorial for beginners 2014 - an introduction to Node.js with Express.js
LearnCode.academy
24 WEB DEVELOPMENT - SECRETS TO STARTING A CAREER in the Web Development Industry
WEB DEVELOPMENT - SECRETS TO STARTING A CAREER in the Web Development Industry
LearnCode.academy
25 jQuery Tutorial #4 - DOM Traversal with jQuery
jQuery Tutorial #4 - DOM Traversal with jQuery
LearnCode.academy
26 jQuery Tutorial #5 - Building a jQuery Tab Panel Widget
jQuery Tutorial #5 - Building a jQuery Tab Panel Widget
LearnCode.academy
27 jQuery Tutorial #6 - Building a jQuery Image Slider
jQuery Tutorial #6 - Building a jQuery Image Slider
LearnCode.academy
28 jQuery Ajax Tutorial #1 - Using AJAX & API's (jQuery Tutorial #7)
jQuery Ajax Tutorial #1 - Using AJAX & API's (jQuery Tutorial #7)
LearnCode.academy
29 jQuery Ajax Tutorial #2 - Posting data to backend (jQuery tutorial #8)
jQuery Ajax Tutorial #2 - Posting data to backend (jQuery tutorial #8)
LearnCode.academy
30 jQuery Ajax Tutorial #3 - Delegating Events & Mustache.js Templating (jQuery tutorial #9)
jQuery Ajax Tutorial #3 - Delegating Events & Mustache.js Templating (jQuery tutorial #9)
LearnCode.academy
31 jQuery Ajax Tutorial #4 - "Edit" modes & Better Mustache.js Templating (jQuery tutorial #9)
jQuery Ajax Tutorial #4 - "Edit" modes & Better Mustache.js Templating (jQuery tutorial #9)
LearnCode.academy
32 How to put your website online - how to FTP to a domain & upload files to a webhost
How to put your website online - how to FTP to a domain & upload files to a webhost
LearnCode.academy
33 Basic Terminal Usage - Cheat Sheet to make the command line EASY
Basic Terminal Usage - Cheat Sheet to make the command line EASY
LearnCode.academy
SSH Tutorial - Basic server administration with SSH
SSH Tutorial - Basic server administration with SSH
LearnCode.academy
35 Vagrant Tutorial - Running a VM For Your Local Development Environment
Vagrant Tutorial - Running a VM For Your Local Development Environment
LearnCode.academy
36 Sublime Text Favorite Packages and Workflow
Sublime Text Favorite Packages and Workflow
LearnCode.academy
37 What Makes Javascript Weird...and AWESOME - Pt 1
What Makes Javascript Weird...and AWESOME - Pt 1
LearnCode.academy
38 Javascript is Event-Driven - What makes Javascript Weird...and Awesome Pt 2
Javascript is Event-Driven - What makes Javascript Weird...and Awesome Pt 2
LearnCode.academy
39 Javascript Closures Tutorial - What makes Javascript Weird...and Awesome Pt 3
Javascript Closures Tutorial - What makes Javascript Weird...and Awesome Pt 3
LearnCode.academy
40 FREE REST API - Practice Developing Javascript AJAX Apps with this API
FREE REST API - Practice Developing Javascript AJAX Apps with this API
LearnCode.academy
41 Javascript Scope Tutorial - What Makes Javascript Weird...and Awesome Pt 4
Javascript Scope Tutorial - What Makes Javascript Weird...and Awesome Pt 4
LearnCode.academy
42 Javascript Context Tutorial - What makes Javascript Weird...and Awesome Pt5
Javascript Context Tutorial - What makes Javascript Weird...and Awesome Pt5
LearnCode.academy
43 Nginx Tutorial - Proxy to Express Application, Load Balancer, Static Cache Files
Nginx Tutorial - Proxy to Express Application, Load Balancer, Static Cache Files
LearnCode.academy
44 Live Reload Sublime, Chrome, Anything - Fast and easy with Live-Server
Live Reload Sublime, Chrome, Anything - Fast and easy with Live-Server
LearnCode.academy
45 Are you bad, good, better or best with Async JS? JS Tutorial: Callbacks, Promises, Generators
Are you bad, good, better or best with Async JS? JS Tutorial: Callbacks, Promises, Generators
LearnCode.academy
46 Javascript Generators - THEY CHANGE EVERYTHING - ES6 Generators Harmony Generators
Javascript Generators - THEY CHANGE EVERYTHING - ES6 Generators Harmony Generators
LearnCode.academy
47 Web Development Advice - Interview with Dev Tips
Web Development Advice - Interview with Dev Tips
LearnCode.academy
48 How the Internet Works for Developers - Pt 2 - Servers & Scaling
How the Internet Works for Developers - Pt 2 - Servers & Scaling
LearnCode.academy
49 How the Internet Works for Developers - Pt 1 - Overview & Frontend
How the Internet Works for Developers - Pt 1 - Overview & Frontend
LearnCode.academy
50 HAPROXY vs NGINX - 10,000 requests while killing servers
HAPROXY vs NGINX - 10,000 requests while killing servers
LearnCode.academy
51 Node.js Cluster - Boost Node App Performance & Stability with Clustering
Node.js Cluster - Boost Node App Performance & Stability with Clustering
LearnCode.academy
52 Web Dev Training with Treehouse
Web Dev Training with Treehouse
LearnCode.academy
53 What is Node.js Exactly? - a beginners introduction to Nodejs
What is Node.js Exactly? - a beginners introduction to Nodejs
LearnCode.academy
54 How to deploy node.js applications #1 - spin up a server
How to deploy node.js applications #1 - spin up a server
LearnCode.academy
55 Deploying node.js applications #2 - provision server & setup flightplan
Deploying node.js applications #2 - provision server & setup flightplan
LearnCode.academy
56 Deploying Node.js Applications - Deploy Node the right way - as an Upstart Service
Deploying Node.js Applications - Deploy Node the right way - as an Upstart Service
LearnCode.academy
57 Mobile Web Design - Coding Workflow For Mobile Websites
Mobile Web Design - Coding Workflow For Mobile Websites
LearnCode.academy
58 WHY YOU NEED A BUILD SYSTEM LIKE GRUNT, GULP, BRUNCH FOR YOUR WEBSITE
WHY YOU NEED A BUILD SYSTEM LIKE GRUNT, GULP, BRUNCH FOR YOUR WEBSITE
LearnCode.academy
59 GRUNT TUTORIAL - Grunt makes your web development better!
GRUNT TUTORIAL - Grunt makes your web development better!
LearnCode.academy
60 STOP USING FTP!  - How to Deploy with Flightplan over SSH
STOP USING FTP! - How to Deploy with Flightplan over SSH
LearnCode.academy

This video teaches the basics of SSH and server administration, including how to connect to a remote machine and configure it. It's a great starting point for web developers who want to level up their skills.

Key Takeaways
  1. Install an SSH client
  2. Generate SSH keys
  3. Connect to a remote machine using SSH
  4. Configure the server
  5. Test the connection
💡 SSH is a secure way to connect to a remote machine and configure it, and it's an essential skill for web developers.

Related Reads

📰
I Built a One-Click Azure CI/CD Pipeline with Terraform & GitHub Actions From git push to a Live Website
Learn to automate Azure CI/CD pipelines using Terraform and GitHub Actions, streamlining deployment from git push to a live website
Dev.to · David Cletus
📰
Part 1.5: Optimizing Dockerfiles with Multi-Stage Builds
Optimize Dockerfiles with multi-stage builds to reduce image sizes, speed up CI/CD pipelines, and improve container security
Dev.to · spmahapatra
📰
The MCP server that changes its mind after you approve it
Learn how MCP servers can change behavior after approval, and why it matters for reliable connections
Dev.to · Abdul Manan
📰
Ingress-nginx Is Retired: A Step-by-Step API Gateway Migration Guide
Migrate from ingress-nginx to an alternative API gateway with this step-by-step guide, ensuring production TLS termination continuity
Medium · DevOps
Up next
Hostinger Web Hosting Review 2026: Features, Pros & Cons 🔥
DroidCrunch
Watch →