SlideShare a Scribd company logo
SSH or Secure Shell program is renowned for its secure operation of network services via a
cryptographic network protocol. In most cases, the network interface in use has questionable
security hence the need for SSH.
Popular application implementations associated with SSH include:
remote login
command-line execution
The basis of SSH applications can be described in the following manner. Firstly, an active and
configured client-server architecture needs to pre-exist. Afterward, an SSH client instance is
used to make a connection attempt to the targeted SSH server.
An SSH client makes use of the secure shell protocol to initiate a connection with a remote
computer. The targeted remote computer needs to have an SSH server installed for it to
validate and authenticate the remote connection attempt from the client computer.
This article will walk us through some elite SSH cheats which can be useful in your day-to-day
client-to-server/remote machine connection and communication.
Quick manual access to the use of SSH can be accessed by running the following command
on your Linux terminal:
$ ssh
To edit your SSH configurations like access port and connection timeout, you will need to
access the configuration file /etc/ssh/ssh_config or /etc/ssh/sshd_config.
$ sudo nano /etc/ssh/ssh_config
OR
$ sudo vim /etc/ssh/sshd_config
To access a remote/server machine from a client machine via SSH, you will need to adhere to
the following command implementation:
$ ssh username@remote_ip_address
You will then be prompted for a password associated with the remote machine’s user before
gaining access.
Useful SSH Cheat Sheet for Linux
Other than gaining direct access to a remote machine and editing the SSH configuration file
to your preference, the following SSH cheats have been proven to be very useful in your
client-to-remote machine communication.
Generate SSH-Keygen
It is a recommendation to make use of the ed25519 algorithm while generating SSH keys.
Consider the implementation below using a random email address:
$ ssh-keygen -t ed25519 -C "linuxshelltips@gmail.com"
For compatibility reasons, you might decide to generate the key via RSA as demonstrated
below:
$ ssh-keygen -t rsa -b 4096 -C "user@linuxshelltips.com"
The -C flag associates each public key with a comment making it easy to link an email
address to its rightful public key. During SSH key generation, always remember to associate
each private key with a passphrase for security purposes.
Connect Server Using SSH Keys
To connect to a remote machine via a specific private key, refer to the following command
implementation:
For ed25519 algorithm generated private keys:
$ ssh -i $HOME/.ssh/id_ed25519 ubuntu@192.168.100.29
For RSA-generated private keys:
$ ssh -i $HOME/.ssh/id_rsa ubuntu@192.168.100.29
Connect Server Using Authorized Keys
If you aim to use your SSH keys (public keys) with a server system or service like Github, you
will need to append a copy of the keys with the file ~/.ssh/authorized_keys on the
remote/server system as demonstrated below.
$ cat ~/.ssh/id_rsa.pub | ssh ubuntu@192.168.100.29 "mkdir -p
~/.ssh && cat >> ~/.ssh/authorized_keys"
Alternatively, the following command also works:
$ ssh-copy-id ubuntu@192.168.100.29
From here, we can connect to the remote machine without being prompted for a password:
$ ssh ubuntu@192.168.100.29
SCP Commands for Upload/Download Files
When wanting to perform file uploads on remote machines:
$ scp simple.txt ubuntu@192.168.100.29:/home/ubuntu/Downloads
When wanting to perform recursive local folder/directory upload to a remote machine:
$ scp -rp mypackage ubuntu@192.168.100.29:/home/ubuntu/Downloads
Downloading/retrieving a file from a remote machine:
$ scp ubuntu@192.168.100.29:/home/ubuntu/Downloads/simple.txt
/home/dnyce/Downloads
Downloading/retrieving a folder/directory recursively from a remote machine:
$ scp -rp
ubuntu@192.168.100.29:/home/ubuntu/Downloads/mypackage
/home/dnyce/Downloads
Using Non-Standard SSH Ports
If the SSH server is running on a non-standard port like 3333, your connection should be
implemented in the following manner:
$ ssh -p 3333 ubuntu@192.168.100.29
Running Commands on Remote Machines
If we want to execute a command on the remote machine like a system update or ping
command after a successful SSH connection, we will implement the following command:
$ ssh -t ubuntu@192.168.100.29 'sudo apt update'
Because we are executing a sudo-privileged command, you will be asked for a user
password.
SSH.pdf

More Related Content

Similar to SSH.pdf

Windowshadoop
WindowshadoopWindowshadoop
Windowshadoop
arunkumar sadhasivam
 
Ssh tunnel
Ssh tunnelSsh tunnel
Ssh tunnel
Amandeep Singh
 
Intro to SSH
Intro to SSHIntro to SSH
Intro to SSH
JP Bourget
 
SSh_part_1.pptx
SSh_part_1.pptxSSh_part_1.pptx
SSh_part_1.pptx
Shelly119532
 
Presentation nix
Presentation nixPresentation nix
Presentation nixfangjiafu
 
Presentation nix
Presentation nixPresentation nix
Presentation nixfangjiafu
 
How to set up ssh keys on ubuntu
How to set up ssh keys on ubuntuHow to set up ssh keys on ubuntu
How to set up ssh keys on ubuntu
collegeinit
 
Rhel5
Rhel5Rhel5
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform EnviornmentNagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios
 
Unit 13 network client
Unit 13 network clientUnit 13 network client
Unit 13 network clientroot_fibo
 
tutorial-ssh.pdf
tutorial-ssh.pdftutorial-ssh.pdf
tutorial-ssh.pdf
NigussMehari4
 
Creating SSH Key.pptx
Creating SSH Key.pptxCreating SSH Key.pptx
Creating SSH Key.pptx
Saumya876452
 
Many times when we login to a system we use a usernamepass.pdf
Many times when we login to a system we use a usernamepass.pdfMany times when we login to a system we use a usernamepass.pdf
Many times when we login to a system we use a usernamepass.pdf
admin447081
 
Discuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdfDiscuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdf
info309708
 
Secure SHell
Secure SHellSecure SHell
Secure SHell
Çağrı Çakır
 
Rasperry pi Part 12
Rasperry pi Part 12Rasperry pi Part 12
Rasperry pi Part 12
Techvilla
 
Up and Running SSH Service - Part 2
Up and Running SSH Service - Part 2Up and Running SSH Service - Part 2
Up and Running SSH Service - Part 2
GLC Networks
 
Using Secure Shell on Linux: What Everyone Should Know
Using Secure Shell on Linux: What Everyone Should KnowUsing Secure Shell on Linux: What Everyone Should Know
Using Secure Shell on Linux: What Everyone Should Know
Novell
 

Similar to SSH.pdf (20)

Windowshadoop
WindowshadoopWindowshadoop
Windowshadoop
 
Ssh tunnel
Ssh tunnelSsh tunnel
Ssh tunnel
 
Intro to SSH
Intro to SSHIntro to SSH
Intro to SSH
 
SSh_part_1.pptx
SSh_part_1.pptxSSh_part_1.pptx
SSh_part_1.pptx
 
Presentation nix
Presentation nixPresentation nix
Presentation nix
 
Presentation nix
Presentation nixPresentation nix
Presentation nix
 
How to set up ssh keys on ubuntu
How to set up ssh keys on ubuntuHow to set up ssh keys on ubuntu
How to set up ssh keys on ubuntu
 
Rhel5
Rhel5Rhel5
Rhel5
 
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform EnviornmentNagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
Nagios Conference 2013 - Leland Lammert - Nagios in a Multi-Platform Enviornment
 
Cent os 5 ssh
Cent os 5 sshCent os 5 ssh
Cent os 5 ssh
 
Unit 13 network client
Unit 13 network clientUnit 13 network client
Unit 13 network client
 
tutorial-ssh.pdf
tutorial-ssh.pdftutorial-ssh.pdf
tutorial-ssh.pdf
 
Advanced open ssh
Advanced open sshAdvanced open ssh
Advanced open ssh
 
Creating SSH Key.pptx
Creating SSH Key.pptxCreating SSH Key.pptx
Creating SSH Key.pptx
 
Many times when we login to a system we use a usernamepass.pdf
Many times when we login to a system we use a usernamepass.pdfMany times when we login to a system we use a usernamepass.pdf
Many times when we login to a system we use a usernamepass.pdf
 
Discuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdfDiscuss what is SSH and the advantages and disadvantages of using it.pdf
Discuss what is SSH and the advantages and disadvantages of using it.pdf
 
Secure SHell
Secure SHellSecure SHell
Secure SHell
 
Rasperry pi Part 12
Rasperry pi Part 12Rasperry pi Part 12
Rasperry pi Part 12
 
Up and Running SSH Service - Part 2
Up and Running SSH Service - Part 2Up and Running SSH Service - Part 2
Up and Running SSH Service - Part 2
 
Using Secure Shell on Linux: What Everyone Should Know
Using Secure Shell on Linux: What Everyone Should KnowUsing Secure Shell on Linux: What Everyone Should Know
Using Secure Shell on Linux: What Everyone Should Know
 

More from AnisSalhi3

Bar Graph Infographicsaaaaaaaaaaaaaaaaaaa
Bar Graph InfographicsaaaaaaaaaaaaaaaaaaaBar Graph Infographicsaaaaaaaaaaaaaaaaaaa
Bar Graph Infographicsaaaaaaaaaaaaaaaaaaa
AnisSalhi3
 
Copie de Robotic Workshop Infographics by Slidesgo.pptx
Copie de Robotic Workshop Infographics by Slidesgo.pptxCopie de Robotic Workshop Infographics by Slidesgo.pptx
Copie de Robotic Workshop Infographics by Slidesgo.pptx
AnisSalhi3
 
Research Proposal Business Presentation in Dark Green Orange Geometric Style.pdf
Research Proposal Business Presentation in Dark Green Orange Geometric Style.pdfResearch Proposal Business Presentation in Dark Green Orange Geometric Style.pdf
Research Proposal Business Presentation in Dark Green Orange Geometric Style.pdf
AnisSalhi3
 
mar07-redis.pdf
mar07-redis.pdfmar07-redis.pdf
mar07-redis.pdf
AnisSalhi3
 
Copie de Introduction to Coding Workshop by Slidesgo.pptx
Copie de Introduction to Coding Workshop by Slidesgo.pptxCopie de Introduction to Coding Workshop by Slidesgo.pptx
Copie de Introduction to Coding Workshop by Slidesgo.pptx
AnisSalhi3
 
JFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptx
JFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptxJFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptx
JFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptx
AnisSalhi3
 
Emplois informatiques.pdf
Emplois informatiques.pdfEmplois informatiques.pdf
Emplois informatiques.pdf
AnisSalhi3
 
Cours Firewalls.pdf
Cours Firewalls.pdfCours Firewalls.pdf
Cours Firewalls.pdf
AnisSalhi3
 
Cloud-Azure.pdf
Cloud-Azure.pdfCloud-Azure.pdf
Cloud-Azure.pdf
AnisSalhi3
 

More from AnisSalhi3 (9)

Bar Graph Infographicsaaaaaaaaaaaaaaaaaaa
Bar Graph InfographicsaaaaaaaaaaaaaaaaaaaBar Graph Infographicsaaaaaaaaaaaaaaaaaaa
Bar Graph Infographicsaaaaaaaaaaaaaaaaaaa
 
Copie de Robotic Workshop Infographics by Slidesgo.pptx
Copie de Robotic Workshop Infographics by Slidesgo.pptxCopie de Robotic Workshop Infographics by Slidesgo.pptx
Copie de Robotic Workshop Infographics by Slidesgo.pptx
 
Research Proposal Business Presentation in Dark Green Orange Geometric Style.pdf
Research Proposal Business Presentation in Dark Green Orange Geometric Style.pdfResearch Proposal Business Presentation in Dark Green Orange Geometric Style.pdf
Research Proposal Business Presentation in Dark Green Orange Geometric Style.pdf
 
mar07-redis.pdf
mar07-redis.pdfmar07-redis.pdf
mar07-redis.pdf
 
Copie de Introduction to Coding Workshop by Slidesgo.pptx
Copie de Introduction to Coding Workshop by Slidesgo.pptxCopie de Introduction to Coding Workshop by Slidesgo.pptx
Copie de Introduction to Coding Workshop by Slidesgo.pptx
 
JFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptx
JFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptxJFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptx
JFTL-2018-Comment-mettre-en-place-des-plateformes-de-test-gr__ce-__-Docker.pptx
 
Emplois informatiques.pdf
Emplois informatiques.pdfEmplois informatiques.pdf
Emplois informatiques.pdf
 
Cours Firewalls.pdf
Cours Firewalls.pdfCours Firewalls.pdf
Cours Firewalls.pdf
 
Cloud-Azure.pdf
Cloud-Azure.pdfCloud-Azure.pdf
Cloud-Azure.pdf
 

Recently uploaded

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

SSH.pdf

  • 1. SSH or Secure Shell program is renowned for its secure operation of network services via a cryptographic network protocol. In most cases, the network interface in use has questionable security hence the need for SSH. Popular application implementations associated with SSH include: remote login command-line execution The basis of SSH applications can be described in the following manner. Firstly, an active and configured client-server architecture needs to pre-exist. Afterward, an SSH client instance is used to make a connection attempt to the targeted SSH server. An SSH client makes use of the secure shell protocol to initiate a connection with a remote computer. The targeted remote computer needs to have an SSH server installed for it to validate and authenticate the remote connection attempt from the client computer. This article will walk us through some elite SSH cheats which can be useful in your day-to-day client-to-server/remote machine connection and communication. Quick manual access to the use of SSH can be accessed by running the following command on your Linux terminal: $ ssh To edit your SSH configurations like access port and connection timeout, you will need to access the configuration file /etc/ssh/ssh_config or /etc/ssh/sshd_config. $ sudo nano /etc/ssh/ssh_config
  • 2. OR $ sudo vim /etc/ssh/sshd_config To access a remote/server machine from a client machine via SSH, you will need to adhere to the following command implementation: $ ssh username@remote_ip_address
  • 3. You will then be prompted for a password associated with the remote machine’s user before gaining access. Useful SSH Cheat Sheet for Linux Other than gaining direct access to a remote machine and editing the SSH configuration file to your preference, the following SSH cheats have been proven to be very useful in your client-to-remote machine communication. Generate SSH-Keygen It is a recommendation to make use of the ed25519 algorithm while generating SSH keys. Consider the implementation below using a random email address: $ ssh-keygen -t ed25519 -C "linuxshelltips@gmail.com"
  • 4. For compatibility reasons, you might decide to generate the key via RSA as demonstrated below: $ ssh-keygen -t rsa -b 4096 -C "user@linuxshelltips.com" The -C flag associates each public key with a comment making it easy to link an email address to its rightful public key. During SSH key generation, always remember to associate each private key with a passphrase for security purposes.
  • 5. Connect Server Using SSH Keys To connect to a remote machine via a specific private key, refer to the following command implementation: For ed25519 algorithm generated private keys: $ ssh -i $HOME/.ssh/id_ed25519 ubuntu@192.168.100.29
  • 6. For RSA-generated private keys: $ ssh -i $HOME/.ssh/id_rsa ubuntu@192.168.100.29 Connect Server Using Authorized Keys If you aim to use your SSH keys (public keys) with a server system or service like Github, you will need to append a copy of the keys with the file ~/.ssh/authorized_keys on the remote/server system as demonstrated below.
  • 7. $ cat ~/.ssh/id_rsa.pub | ssh ubuntu@192.168.100.29 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" Alternatively, the following command also works: $ ssh-copy-id ubuntu@192.168.100.29 From here, we can connect to the remote machine without being prompted for a password: $ ssh ubuntu@192.168.100.29
  • 8. SCP Commands for Upload/Download Files When wanting to perform file uploads on remote machines: $ scp simple.txt ubuntu@192.168.100.29:/home/ubuntu/Downloads When wanting to perform recursive local folder/directory upload to a remote machine: $ scp -rp mypackage ubuntu@192.168.100.29:/home/ubuntu/Downloads
  • 9. Downloading/retrieving a file from a remote machine: $ scp ubuntu@192.168.100.29:/home/ubuntu/Downloads/simple.txt /home/dnyce/Downloads Downloading/retrieving a folder/directory recursively from a remote machine: $ scp -rp ubuntu@192.168.100.29:/home/ubuntu/Downloads/mypackage /home/dnyce/Downloads
  • 10. Using Non-Standard SSH Ports If the SSH server is running on a non-standard port like 3333, your connection should be implemented in the following manner: $ ssh -p 3333 ubuntu@192.168.100.29 Running Commands on Remote Machines If we want to execute a command on the remote machine like a system update or ping command after a successful SSH connection, we will implement the following command: $ ssh -t ubuntu@192.168.100.29 'sudo apt update' Because we are executing a sudo-privileged command, you will be asked for a user password.