Skip to content

Commit 5604851

Browse files
authored
more about ssh
1 parent c6d8b10 commit 5604851

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,13 +649,16 @@ Regular expressions.
649649
- `id_rsa`: private key.
650650
- `id_rsa.pub`: public key.
651651
- ssh server configuration:
652-
- the config file to edit is `/etc/sshd_config`.
652+
- the config file for ssh server to edit is `/etc/sshd_config`, the config for the client ssh is `/etc/ssh_config`.
653653
- we can edit some configurations like port number, prohibit root login, no user/password authentication....
654654
- We can allow only some users or groups to connect via ssh with `AllowsUsers groupname user1 user2`
655655
- keys generation:
656656
- ssh-key-gen: to generate new keys, by default they will be placed inside `.ssh` folder, `id_rsa` as default name of the private key, `id_rsa.pub` as default public key name, the private key should be kept private.
657657
- `ssh-copy-id -i /.ssh/id_rsa.pub username@1.2.3.4`: to copy the public to the remote ssh server, with that further logging will succeed without passing password or publickey.
658658
- `ssh-copy-id` will copy our public key to the remote `/.ssh/authorized_keys` file in the ssh server. In the authorized_keys file, every line represent a client ssh public key.
659+
- `ssh root@1.1.1.1 ls /etc`: will run the command directly `ls /etc` on the remote server throught ssh without the need to get to a shell, we can use the option `-t` if there is a need for a terminal, example using vim editor.
660+
- `last`, `lastb`, : to check last logging activities, `last` for successful logging, `lastb` for bad logging.
661+
- `man sshd_config`: for the man page of the sshd_config file.
659662

660663
## Bash history
661664
- `history`: to print history of typed commands, every command will have an number associated.

0 commit comments

Comments
 (0)