https://github.com/noraworld/ssh-conf
https://github.com/noraworld/ssh-conf
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/noraworld/ssh-conf
- Owner: noraworld
- Created: 2021-03-30T14:41:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T13:07:27.000Z (about 3 years ago)
- Last Synced: 2025-01-11T21:27:48.609Z (9 months ago)
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ssh-conf
SSH config files.## Setup
```shell
cd ssh-conf
sudo rm /etc/ssh/sshd_config
sudo ln -s $PWD/ssh/sshd_config /etc/ssh
sudo rm -r /etc/ssh/sshd_config.d
sudo ln -s $PWD/ssh/sshd_config.d /etc/ssh
sudo rm /etc/ssh/ssh_config
sudo ln -s $PWD/ssh/ssh_config /etc/ssh
```Generate random port number and add it to `ssh/sshd_config.d/port.conf`.
```shell
# DO NOT EXECUTE BELOW MANY TIMES IN A ROW!
echo "Port $(od -An -tu2 -N2 /dev/random | tr -d ' ')" | tee -a $PWD/ssh/sshd_config.d/port.conf
```If the above command takes too much time, you can use `/dev/urandom` instead of `/dev/random`, but note that the precision of the random number of `/dev/urandom` is poorer than that of `/dev/random`.
cf. https://webbibouroku.com/Blog/Article/linux-rand (Japanese)