• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

SSH Command

Written by Admin, Updated On September 23, 2020
ssh, terminal
SSH Command in Linux

SSH, Secure Shell is a protocol used for an encrypted connection between client machine and server. Using it client machine will make a secure connection to the SSH server on a remote system. By this connection user can run commands on remove server. In this tutorial we will show you how to use OpenSSH command-line client with ssh command to make connection with remote machine.

There are many free and commercial SSH clients are available for Linux, Windows, macOS and others. The OpenSSH is the most widely using ssh client. Let’s see how to install OpenSSH client.

Install OpenSSH Client#

The OpenSSH client is also known as ssh. The OpenSSH client package also includes other SSH utilities such as scp and sftp.

Install OpenSSH Client on Linux#

By default, OpenSSH client is pre-installed on most of Linux distributions. If your machine doesn’t have the ssh client installed then you can install it using package manager:

Install OpenSSH on Ubuntu and Debian#

sudo apt update
sudo apt install openssh-client

Installing OpenSSH on CentOS and Fedora#

sudo dnf install openssh-clients

Install OpenSSH Client on Windows 10#

In Windows system, mostly PuTTy program is used to connect a remote server over the SSH. Windows 10 includes OpenSSH client and server. You can install it using PowerShell:

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

It will show following output on success:

Path          :
Online        : True
RestartNeeded : False

Installing OpenSSH Client on macOS#

By default, macOS ships with the OpenSSH client installed.

How to Use the ssh Command#

You should check the following point before login to a remote machine using SSH:

  • The SSH server must be running on the remote machine.
  • An SSH port must be open in the remote machine firewall.
  • You must know the username and the password of the remote account. The account needs to have proper privileges for remote login.

Below is the syntax of the ssh command:

ssh [OPTIONS] [USER@]:HOST

Type ssh in your terminal or PowerShell followed by the remote host name and port. If you have not change default SSH port then not need to mention the port it will take by default port 22:

ssh tecnstuff@192.168.1.10

On first time login it will show message like below:

The authenticity of host '192.168.1.10' can't be established.
ECDSA key fingerprint is SHA256:aydt22mbSuNuB5unE++yowF7lgA/38bLSiO3qmDS.
Are you sure you want to continue connecting (yes/no)?

Output will different for each user and the fingerprint stored in ~/.ssh/known_hosts file.

You should type yes to go ahead and store the remote fingerprint. After that it will ask to enter your password:

Warning: Permanently added '192.168.1.10' (ECDSA) to the list of known hosts.
tecnstuff@192.168.1.10's password:

On successful authentication, you will be logged in to your remote machine.

Conclusion#

You can make connection to your remote server via SSH using the ssh command.

If you have any questions, please leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install and Use FFmpeg on Ubuntu 20.04
Next Article   History Command in Linux (Bash History)

Related Posts

  • How to Install SSH Keys on Ubuntu 22.04

    How to Set up SSH Keys on Ubuntu 22.04

    January 7, 2023
  • How to Install Fail2ban on Ubuntu 22.04

    How to Install and Configure Fail2ban on Ubuntu 22.04

    December 5, 2022
  • How to Enable SSH on Ubuntu 22.04

    How to Enable SSH on Ubuntu 22.04

    December 1, 2022

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
  • How to Install MariaDB on Debian 11 Bullseye
    How to Install MariaDB on Debian 11 Bullseye March 8, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook