mise au point
This commit is contained in:
@@ -1,20 +1,33 @@
|
|||||||
|
:Q
|
||||||
## Sur votre windows dans un terminal
|
## Sur votre windows dans un terminal
|
||||||
ssh-keygen
|
ssh-keygen
|
||||||
scp -P #machine .ssh\.id_rsa.pub epsi@cours.opendoor.fr:
|
scp -P #machine .ssh\.id_rsa.pub root@cours.opendoor.fr:
|
||||||
|
|
||||||
## Sur le container connecté en tant qu'utilisateur epsi
|
## Sur le container connecté en tant qu'utilisateur root
|
||||||
|
|
||||||
mkdir -pm 0700 ~/.ssh
|
|
||||||
|
useradd -d -m /home/formation -G wheel formation
|
||||||
|
echo '123Soleil2020!!' | passwd --stdin formation
|
||||||
|
cd ~formation
|
||||||
|
mkdir -pm 0700 .ssh
|
||||||
cat id_rsa.pub >> .ssh/authorized_keys
|
cat id_rsa.pub >> .ssh/authorized_keys
|
||||||
|
curl https://infra.opendoor.fr/id_rsa.pub >> .ssh/authorized_keys
|
||||||
|
chmod 600 .ssh/authorized_keys
|
||||||
|
|
||||||
|
cd ~root
|
||||||
|
mkdir -pm 0700 .ssh
|
||||||
|
cat id_rsa.pub >> .ssh/authorized_keys
|
||||||
|
curl https://infra.opendoor.fr/id_rsa.pub >> .ssh/authorized_keys
|
||||||
chmod 600 .ssh/authorized_keys
|
chmod 600 .ssh/authorized_keys
|
||||||
|
|
||||||
sudo vim /etc/ssh/sshd_config
|
sudo vim /etc/ssh/sshd_config
|
||||||
|
|
||||||
...
|
...
|
||||||
PermitRootLogin without-password
|
PermitRootLogin no
|
||||||
...
|
|
||||||
AllowGroups wheel root
|
|
||||||
AllowUsers root@100.0.0.1
|
|
||||||
PasswordAuthentication no
|
PasswordAuthentication no
|
||||||
|
...
|
||||||
|
Match Address 100.0.0.1
|
||||||
|
PermitRootLogin without-password
|
||||||
|
Match All
|
||||||
|
|
||||||
sudo systemctl restart sshd
|
sudo systemctl restart sshd
|
||||||
|
|||||||
Reference in New Issue
Block a user