diff options
author | Jesús <heckyel@hyperbola.info> | 2021-04-15 18:31:08 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-04-15 18:31:08 -0500 |
commit | f85953c06051170bb89d21e5c1d7c7b5efaaf19b (patch) | |
tree | b7eae1b3509e8e299e758d08a58c172de1acbe5f | |
parent | 1ac6191bc46868c335450e75729531558df0c8d0 (diff) | |
download | book-f85953c06051170bb89d21e5c1d7c7b5efaaf19b.tar.lz book-f85953c06051170bb89d21e5c1d7c7b5efaaf19b.tar.xz book-f85953c06051170bb89d21e5c1d7c7b5efaaf19b.zip |
[ssh] update to ed25519
-rw-r--r-- | ssh/README.md | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/ssh/README.md b/ssh/README.md index 3901a77..c2998d6 100644 --- a/ssh/README.md +++ b/ssh/README.md @@ -2,23 +2,23 @@ ### Generate SSH key pair -#### Medium security - - ssh-keygen -b 4096 - -#### High security - - ssh-keygen -b 16384 +```console +$ ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "john@example.com" +``` #### Change private key permissions - chmod 600 ~/.ssh/id_rsa +```console +$ chmod 600 ~/.ssh/id_ed25519 +``` ### Client usage To connect to a server, run: - ssh -p port user@server-address +``` +$ ssh -p port user@server-address +``` `port` for default is `22` @@ -31,9 +31,9 @@ To connect to a server, run: The client can be configured to store common options and hosts. All options can be declared globally or restricted to specific hosts. For example: -``` -~/.ssh/config - +```bash +nano -w ~/.ssh/config +------------------------------- # host-specific options Host myserver HostName ssh.heckyel.ga @@ -45,9 +45,13 @@ Host myserver With such a configuration, the following commands are equivalent -`ssh -p port user@server-address` +```console +$ ssh -p port user@server-address +``` -`ssh myserver` +```console +$ ssh myserver +``` ### Server usage @@ -73,4 +77,6 @@ For additional protection, you can prevent users from adding new public keys and In the server, make the authorized_keys file read-only for the user and deny all other permissions: - chmod 400 ~/.ssh/authorized_keys +```console +$ chmod 400 ~/.ssh/authorized_keys +``` |