en:linux:ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:linux:ssh [2023/10/18 22:49] – angelegt psycoreen:linux:ssh [2024/02/05 16:49] (current) – old revision restored (2024/01/24 11:23) psycore
Line 1: Line 1:
-====== Back up the sshd ======+{{tag>english linux debian sshd it-security}} 
 +====== Backing up the sshd ======
  
-The pre-installed SSH daemon (sshd) is insecure in the basic configuration. To ensure greater protection, it is necessary to integrate a [[wpde>Asymmetrisches_Kryptosystem|key authentication]].+The pre-installed SSH daemon (sshd) is insecure in the basic configuration. To ensure greater protection, it is necessary to integrate a [[wpde>Asymmetrisches_Kryptosystem|to integrate key authentication]].
  
  
-===== Create key pair =====+===== Generate key pair =====
  
-First, we create a key pair under Linux:+Firstly, we create a key pair under Linux:
  
 <code bash> <code bash>
Line 19: Line 20:
 35:9f:6e:c2:46:62:09:2d:dc:dd:1e:79:cc:56:d9:2b root@v05-s42 35:9f:6e:c2:46:62:09:2d:dc:dd:1e:79:cc:56:d9:2b root@v05-s42
 </code> </code>
-**Be sure to enter a password, otherwise you can access the server just by possessing the private key!**+**Be sure to enter a password, otherwise you can access the server simply by possessing the private key!**
  
-We rename id_rsa.pub to authorised_keys and download id_rsa locally to our computer. **It is important to delete id_rsa securely afterwards!** (if necessary install wipe with //apt-get install wipe//)+We rename id_rsa.pub to authorised_keys and download id_rsa locally to the computer. **It is important to delete id_rsa securely afterwards!** (If necessaryinstall wipe with //apt-get install wipe//)
  
 <code bash>$ wipe id_rsa <code bash>$ wipe id_rsa
Line 39: Line 40:
 ===== Putty Private Key ===== ===== Putty Private Key =====
  
-Now we download [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|puttygen.exe]] down. We open puttygen.exe and navigate in the menu to **Conversion / Import Key**. At this point we select the generated private key that we have downloaded to our computer. Now add a suitable comment and we can click on **save private key** button.+Now we download [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|puttygen.exe]] down. We open puttygen.exe and navigate in the menu to **Conversion / Import Key**. At this pointwe select the generated private key that we have downloaded to our computer. Now add a suitable comment and we can click on **save private key** button.
  
-We need this key with the .ppk extension to log in later for putty. **Never upload this key to the server!**+We will need this key with the .ppk extension to log in to putty later. **Never upload this key to the server!**
  
  
 ===== Login test ===== ===== Login test =====
  
-Now we test whether the connection is established with the generated key. To do this, we open putty.exe and enter the host name as usual. Before we click on **open** we switch to the left in the tree view to **Connection / SSH / Auth** and enter the following under **private key file for authentication** enter the path to our ppk file. Now click on **open** button. If the login was successful, and without error messages, we can completely disable password authentication in our sshd.+Now we test whether the connection is established with the generated key. To do this, we open putty.exe and enter the host name as usual. Before we now click on **open** we switch to the left in the tree view to **Connection / SSH / Auth** and under **private key file for authentication** and enter the path to our ppk file. Now click on **open** button. If the login was successful, and without error message, we can completely deactivate the password authentication in our sshd.
  
 ===== sshd configuration ===== ===== sshd configuration =====
Line 82: Line 83:
 <code bash>/etc/init.d/ssh restart</code> <code bash>/etc/init.d/ssh restart</code>
  
-==== Note ====+==== Hint ====
  
-The current SSH session is not closed. **To correct configuration errors, the current session should remain open until everything is working properly!** +The current SSH session is not closed. **To correct configuration errors, the current session should remain open until everything is working correctly!**
- +
-===== Copyright and notes ===== +
- +
-© by [[psycore]] 2020 +
- +
-The author accepts no liability for any damage resulting from the use of this tutorial. This tutorial is written to the best of my knowledge and belief. The distribution of this tutorial is only allowed if the original text including copyright remains untouched.+
  • en/linux/ssh.1697662169.txt.gz
  • Last modified: 2023/10/18 22:49
  • by psycore