How to install and use SSH on Linux

How to install and use SSH on Linux


SSH or Secure Shell allows you to connect
between computers and encrypt traffic between them. For example, I use ssh to connect to my virtual
private server and to my office computer. Usually, it works only through the terminal. However, you can connect it to your file manager
or use some graphical programs like FileZilla, if you do not want to type commands. And you can also use graphical forwarding to open graphical programs from the remote server in your local computer. So, in this video, you will learn how to install, configure, and use ssh In particular, you will learn how to
configure Local client computer. and Remote server computer Make sure your firewall doesn’t block the ssh connection. How to establish a connection with a terminal,
FileZilla and your File manager. How to open remote graphical programs. And how to transfer file between computers
using ssh. Before we start with the tutorial, I would
like to recommend you UpCloud virtual server provider. If you have never used ssh or you just need
a private server, you can register at UpCloud.com and get $25 to your account with the promo
code alu25. With UpCloud you will get a private cloud
server running in a few minutes as I showed in my previous video. They provide the fastest servers with great
reliability and very responsive support. It also has ssh already installed and working. I will use UpCloud to show you how to use
ssh in this video. If you get an UpCloud server, you can do the
same and beyond. So, let’s start with the actual tutorial. First, you need to set up your client Linux
machine. This is the computer you will use to connect
from. It is pretty easy, install openssh-client
on your Linux computer and you are done. This an example command for Debian and Debian-based
distros, such as Ubuntu. I provide the install commands for other distros
in the description. If you also want to use Windows as a client
install PuTTY. Next, configure the computer you want to connect
to. On the remote computer, you need to install
openssh-server. Again, see the install commands for other
distros in the description. Obviously, you will need to have physical
access to the remote computer to install this package. check that ssh is running with
systemctl status ssh You should see that it is active. If it has not started it manually or simply reboot the system. Next, you need to determine the IP address
of this remote computer. The easiest way is to check the network settings. If you have a graphical desktop in that computer,
open the network settings and search for IP address. This is how it looks in Plasma 5 and in Ubuntu Gnome. If you only have the command line, run
ip a Usually, you will see your ip address in the
eth0 connection. Write down this address, you will need it
to be able to connect to this remote computer. Firewall It is possible that you use a firewall and it may block your remote access. So, check open ports and you should see port 22 open in your remote computer again I provide the commands in the description If you do not find port 22 open among open
ports, go to your firewall settings and open it. If you use UFW run this command: I talked about whether you need a firewall
in Linux and how to use it in this video. I recommend you to watch it. How to connect to a remote computer In your client Linux computer, run ssh username of your remote computer and the IP address of your remote computer this is the IP address you wrote down in a previous step. if you get a warning: Are you sure you want
to continue connecting (yes/no)? type yes. After you typed the password of your user
at the remote computer, you will be logged in to a remote Linux computer. Now, you can work on this remote computer as if you would be sitting in front of that computer and using the terminal. if you simply want to work with files without running any programs you can also connect
to your remote server with FilleZilla. In FilleZilla, go to the site manager. Add new site. Select SFT protocol. Add your IP address user name Password and click connect You will get your local files on the left
and your remote files on the right. You can navigate here with your mouse and
transfer files between your computers by simply moving them here. Similarly, you can add the remote server to you File Manager. Go to the Network in your file manager, click
add Network folder, select ssh, Give a name to this folder, Provide the user name of a remote account, IP address, Protocol keep sftp and the remote folder path you want to connect. Usually, it is the remote user home folder. As a result, you will see all folder and files
of your remote computer in your file manager. You can also forward graphical application
from your remote computer to your local computer. To do that, you simply need to add the option
-X during the login. Now, if you start any graphical program in
a remote computer, it will open in your local computer like this firefox in my case. of course the performance of these graphical programs will depend on your internet connection. Transfer files To transfer a file to a remote computer in the terminal. Run
scp path to the local file and path to the file in the remote server. And from a remote computer to your local computer:
simply type first the remote address and then the local. As you have seen ssh is a pretty handy program. It is not difficult to install and use. However, there are some more configurations
which I did not cover in this video. For example, you can enhance the security
of your ssh connection with shh keys and white-listed ip addresses. I will cover this topic in the next video. So, subscribe by clicking on the logo icon
you see on the screen right now. And do not forget to try UpCloud, I am sure
you won’t be disappointed. Thank you for watching.

22 thoughts on “How to install and use SSH on Linux

  1. Get a Private Virtual Server and $25 for free at UpCloud: https://upcloud.com/signup/?promo=alu25
    1:50 Configure Local client computer.
    2:15 Configure Remote server computer
    3:20 Make sure your firewall doesn't block the ssh connection.
    3:56 How to establish a connection with a terminal, FileZilla and your File manager.
    5:44 How to open remote graphical programs.
    6:08 How to transfer file between computers using ssh.

  2. Great video, how would you ssh to a computer if its over the internet as I don't understand how to do it, as all the computers seem to have the same internet IP address which makes it impossible to choose a machine to ssh to?

  3. Windows 10 have a built-in SSH Client, go to Settings > Apps > Apps and Features > Manage Optional Features

  4. Hello ALU ssh is not primarily used to transfer files so FileZilla and sftp through the file manager should have been covered in a video about FTP!
    You need to show SSHFS as well in your next video. You forgot to explain the options of lsof! You should have shown the config files of the server and where the keys are located.
    You should have explained the principles of the public key and the private key. All in all the will to have a video about ssh in less than 10 minutes is a bad idea.
    This guy has done a video only about ssh keys: https://www.youtube.com/watch?v=mF6J-VQHPxA
    So if you make short videos about ssh you need to do at least five or six videos to cover the subject like theurbanpenguin did it.
    Cheers

  5. Great video as usual.
    I have a suggestion:
    Please don't make the linux terminal full screen when recording the screen, as sometimes when I want to follow and copy a command, pausing the video, youtube full screen has Header (with video title on it) and the footer (with video time line and the other controls on it) and these header or sometimes the footer covers the actual terminal line to type from.
    Thanks

  6. This tutorial is also available in text https://averagelinuxuser.com/how-to-install-and-use-ssh-on-linux/

  7. Hi…nice informative video. Question though…if someone is to access via putty his server not being at the local network (the client pc) how can you manage that? Tried to enter in Putty [email protected]_name but probably its common logic that Putty cant relate the server name with its IP on a remote site. Only with DDNS or something similar?

    I am talking about a server in a network with a dynamic IP setup
    PS ufw is enabled in case that matters

  8. Also to my previous comment. i generated the ssh files from the server side (not from the client as in your video). Now when i issued the command ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] i put ok the username (lets say it test) and the address of the server I was already logged in.

    In your write tutorial you mention that this command will create a file <<It will copy your public key to the authorized_keys file in ~/.ssh folder of the remote computer.>> Well in mine with ls -a in home/user.name/.ssh it created a known_hosts file and not the authorized_keys file . Why is that?

Leave a Reply

Your email address will not be published. Required fields are marked *