[ssh]: update

This commit is contained in:
Jesús 2021-05-23 15:15:48 -05:00
parent f0ba596bb1
commit 0cedeb0f68
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -16,7 +16,7 @@ $ chmod 600 ~/.ssh/id_ed25519
To connect to a server, run:
```
```console
$ ssh -p port user@server-address
```
@ -25,15 +25,17 @@ $ ssh -p port user@server-address
#### Copy SSH key
1. `sudo apt-get install xclip` or `sudo pacman -S xclip`
2. `xclip -sel clip < ~/.ssh/id_rsa.pub`
2. `xclip -sel clip < ~/.ssh/id_ed25519.pub`
#### Configuration
The client can be configured to store common options and hosts. All options can be declared globally or restricted to specific hosts. For example:
```console
$ nano -w ~/.ssh/config
```
```bash
nano -w ~/.ssh/config
-------------------------------
# host-specific options
Host myserver
HostName ssh.heckyel.ga
@ -61,15 +63,21 @@ The SSH daemon configuration file can be found and edited in /etc/ssh/sshd_confi
To allow access only for some users add this line:
AllowUsers user1 user2
```bash
AllowUsers user1 user2
```
To allow access only for some groups:
AllowGroups group1 group2
```bash
AllowGroups group1 group2
```
To add a nice welcome message (e.g. from the /etc/issue file), configure the Banner option:
Banner /etc/issue
```bash
Banner /etc/issue
```
#### Securing the authorized_keys file