Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

SSH Command - DesignLinux

Sep 24 2020
designlinux 0 Comments
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 [email protected]

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.
[email protected]'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.

Related

Tags: ssh, terminal

How to Install and Use FFmpeg on Ubuntu 20.04

Prev Post

10 Linux Distributions and Their Targeted Users

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 696
  • 615,068

DesignLinux.com © All rights reserved

Go to mobile version