34 lines
880 B
Markdown
34 lines
880 B
Markdown
# Meine Public Keys
|
|
## Hardware Keys
|
|
Swiss Token2
|
|
Solokey USB C
|
|
Solokey USB A
|
|
OnlyKey
|
|
|
|
Die Schlüssel können mit ssh-keygen -K wieder hergestellt werden. Dabei entstehen der private und der öffentliche Schlüssel im aktuellen Verzeichnis neu.
|
|
|
|
|
|
KeyAuthentication
|
|
```
|
|
cd
|
|
mkdir -p ~/.ssh
|
|
chmod 700 ~/.ssh
|
|
cd .ssh
|
|
wget https://git.rwolff.homelinux.net/rpwolff/public-keys/raw/branch/master/authorized_keys
|
|
chmod 600 ~/.ssh/authorized_keys
|
|
```
|
|
|
|
Disable Passwortauthentication
|
|
```
|
|
sed -ri "s/^#? *PasswordAuthentication *yes.*/PasswordAuthentication no/" /etc/ssh/sshd_config
|
|
sed -i 's|UsePAM yes|UsePAM no|g' /etc/ssh/sshd_config
|
|
systemctl restart ssh
|
|
```
|
|
|
|
Enable Passwortauthentication
|
|
```
|
|
sed -i 's|[#]*PasswordAuthentication no|PasswordAuthentication yes|g' /etc/ssh/sshd_config
|
|
sed -i 's|UsePAM no|UsePAM yes|g' /etc/ssh/sshd_config
|
|
service ssh restart
|
|
```
|