From 052b65b3210114eb7d0d2aac9f11dd45eb9bb12a Mon Sep 17 00:00:00 2001 From: develcooking Date: Tue, 26 Nov 2024 03:03:57 +0000 Subject: [PATCH] en/README.md aktualisiert --- en/README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/en/README.md b/en/README.md index ec4b341..29a1b99 100644 --- a/en/README.md +++ b/en/README.md @@ -294,7 +294,33 @@ for more examples [see](https://linuxize.com/post/regular-expressions-in-grep/) ### ssh -WIP +SSH is a remote tool to connect and administrate a bunch of systems. You can compare it to products like Teamviewer or Microsofts Remote deskop app. We will go over the base model of ssh first. + +This articel from [digial ocean](https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server) is a great learning ground + +##### ssh client server model +So to connect to a ssh server you will need a ssh server and a ssh client. A popular ssh server is the OpenSSH-Server or the Windows-SSH Server. Popular clients are the OpenSSH-Clients available on every OS. Another popular SSH client is Putty on windows. + +##### SSH server config +SSH is a daemon service which can be controled via systemctl. You could restart ssh for ex. with + +``` +systemctl restart ssh +``` + +We will here only mension Linux's OpenSSH server. On a default server you will have a ssh server preinstalled. In `/etc/ssh/sshd_config` you can configure globle settings for your ssh server like the port which the server will be accessible in the future. Another big talking point is root access on a server. A direct root access should be disabled accept you are only using a ssh keypair. A keypair is like a key and a doorlock. Only a key can open the door. If you use ssh-keygen you will have a private and public key. A private key should be allways keept private. Nobody else exapt you should have access to your private ssh key. The public key is to be placed on your server we will later get to this. + +##### Setup ssh on the client and server for a safe connection +Please make sure to have genereate a ssh keypair via [ssh-keygen](https://www.ssh.com/academy/ssh/keygen), it works on win terminal, linux and MacOS. +If you done that you will have two new files in you `$HOME/.ssh/` directory. Here we can use cat to cat out the `.pub` key. You can copy it to your clipboard. + + +If you are connected to a ssh server you will go into the Home directory of the user you want to connect as. In case of the root user `/root` otherwise `/home/$USERNAME`. You have to create now probaly a dir called .ssh `mkdir .ssh`. In there we now create a file called "authorized_keys". We will now edit it via our text editor of choice. You will now paste you public key into there. It should be oneliner. If it all worked, you can test the connection via +``` +ssh @ +``` +. If you dont know the ip address of you server you can use `ip a ` to show that to you. + ### scp WIP