educare:open-ssh
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
educare:open-ssh [2020/06/08 22:20] – external edit 127.0.0.1 | educare:open-ssh [2023/06/15 13:42] (current) – profpro | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | < [[educare: | ||
+ | |||
====== Open-ssh ====== | ====== Open-ssh ====== | ||
Permette di controllare un computer a distanza crittografando la comunicazione | Permette di controllare un computer a distanza crittografando la comunicazione | ||
+ | |||
https:// | https:// | ||
- | ==== Sul server ==== | ||
- | - Installare // | + | ==== Sul server (prima parte) ==== |
- | | + | |
- | - Configurare // / | + | * Installare // |
- | | + | |
- | | + | |
- | PermitRootLogin no | + | |
- | AllowUsers mioutente | + | |
- | AllowGroups miogruppo</ | + | * per aumentare le difese vedere |
- | - invoke-rc.d ssh restart | + | |
+ | * creare il nuovo utente (non root) | ||
+ | |||
+ | | ||
+ | |||
+ | * aggiungerlo al gruppo sudo (solo su ubuntu, non su debian) | ||
+ | |||
+ | usermod | ||
+ | |||
+ | **Nota:** (prima di andare avanti, configurare il client, vedi sotto) | ||
- | https:// | ||
==== Sul client ==== | ==== Sul client ==== | ||
- | | + | |
- | - Configurare // /etc/ssh/ssh_config// | + | |
- | - Il seguente comando genera una nuova coppia di chiavi, da copiare sul server... | + | |
- | - //ssh-keygen -t rsa// (chiede una passphrase e salva le chiavi in ~/.ssh) | + | |
+ | * verificare prima se esistono eventuali chiavi | ||
+ | |||
+ | cat ~/.ssh/id_rsa.pub | ||
+ | | ||
+ | |||
+ | * copiare | ||
+ | |||
+ | ssh-copy-id mario@x.x.x.x | ||
+ | ... | ||
+ | Number of key(s) added: 1 | ||
+ | |||
+ | * Configurare il client ~/.ssh/ssh_config/ | ||
+ | |||
+ | PubkeyAuthentication=yes | ||
+ | PreferredAuthentications=publickey, | ||
+ | IdentitiesOnly=yes | ||
+ | |||
+ | per collegarsi | ||
+ | Dovrebbe chiedere la passphrase | ||
+ | |||
+ | ssh mario@x.x.x.x | ||
+ | |||
+ | (Se la connessione con chiave riesce, | ||
+ | |||
+ | ==== Sul server (Seconda parte) ==== | ||
+ | |||
+ | * Configurare // /etc/ssh/ | ||
+ | * opzioni da editare: | ||
+ | |||
+ | (Se la connessione con chiave riesce, e se si riesce anche a diventare superutente si può continuare) | ||
+ | |||
+ | < | ||
+ | PasswordAuthentication no | ||
+ | PermitRootLogin no | ||
+ | LogLevel VERBOSE | ||
+ | AllowGroups ........</ | ||
- | per collegarsi | + | systemctl restart sshd |
- | ssh mioutente@indirizzoserver |
educare/open-ssh.1591647601.txt.gz · Last modified: 2020/06/08 22:20 by 127.0.0.1