doc(ubuntu): add ubuntu 24.11 instructions #25
1 changed files with 6 additions and 14 deletions
20
Ubuntu.md
20
Ubuntu.md
|
@ -14,7 +14,7 @@ is running by default.
|
||||||
## Generate strong key on your laptop or workstation/desktop
|
## Generate strong key on your laptop or workstation/desktop
|
||||||
## If you already have keys DO NOT overwrite your previous keys
|
## If you already have keys DO NOT overwrite your previous keys
|
||||||
|
|
||||||
ssh-keygen
|
ssh-keygen -t ed25519 -a 32 -f ~/.ssh/$localhost-to-$remotehost
|
||||||
|
|
||||||
## Optionally set a passphrase
|
## Optionally set a passphrase
|
||||||
|
|
||||||
|
@ -27,21 +27,13 @@ ssh-copy-id username@remote_host
|
||||||
We don't want to allow anyone to login as root remotely ever. You must be a
|
We don't want to allow anyone to login as root remotely ever. You must be a
|
||||||
`sudoer` with public key auth to elevate to root.
|
`sudoer` with public key auth to elevate to root.
|
||||||
|
|
||||||
SSH into your server and run `sudoedit /etc/ssh/sshd_config`
|
SSH into your server and run
|
||||||
|
|
||||||
See
|
|
||||||
[stackoverflow question](https://superuser.com/questions/785187/sudoedit-why-use-it-over-sudo-vi)
|
|
||||||
for reasons to use sudoedit over sudo.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
## Uncomment PasswordAuthentication and set value to no
|
printf '%s\n' 'PermitRootLogin no' | sudo tee /etc/ssh/sshd_config.d/01-root.conf
|
||||||
PasswordAuthentication no
|
printf '%s\n' \
|
||||||
|
'PubkeyAuthentication yes' \
|
||||||
## Disable root login
|
'PasswordAuthentication no' | sudo tee /etc/ssh/sshd_config.d/01-pubkey.conf
|
||||||
PermitRootLogin no
|
|
||||||
|
|
||||||
## Optionally disable X11 forwarding
|
|
||||||
X11Forwarding no
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Save file and then run `systemctl restart ssh` Before closing your session, open
|
Save file and then run `systemctl restart ssh` Before closing your session, open
|
||||||
|
|
Loading…
Add table
Reference in a new issue