Update readme file, add server list sample file

This commit is contained in:
Clemens Schwaighofer
2024-09-25 12:11:49 +09:00
parent a27ca6a455
commit f9ac606682
3 changed files with 20 additions and 7 deletions

View File

@@ -13,14 +13,16 @@ These scripts are mainly destinated to rotate the SSH key, a set of scripts is f
- /etc/ssh/authorized_keys--master - /etc/ssh/authorized_keys--master
- /etc/ssh/authorized_keys/$USER - /etc/ssh/authorized_keys/$USER
Then remove old key Then remove old key (with the remove script)
Store ssh key name for current period in your `ssh-public-keys/admin-current/` folder Stores the public ssh key name for current period in the local `ssh-public-keys/admin-current/` folder
## Settings files ## Settings files
### `settings.ini` ### `settings.ini`
Sample file: `settings.sample.ini`
```ini ```ini
[Settings] [Settings]
key_age=90 key_age=90
@@ -35,7 +37,9 @@ server_pem_archive_folder=~/folder/for/archive/pems/
- server_pem_folder is the location for the PEM files, eg in a ~/.ssh/ sub folder - server_pem_folder is the location for the PEM files, eg in a ~/.ssh/ sub folder
- server_pem_archive_folder is the location for the archive files, a sub folder will be created there - server_pem_archive_folder is the location for the archive files, a sub folder will be created there
### server_list file ### `server_list.csv` file
Sample file: `server_list.sample.csv`
This file is not kept in the repository for security purpose. <<< to specify >>> This file is not kept in the repository for security purpose. <<< to specify >>>
@@ -50,15 +54,17 @@ This file is semicolon ';' separated and not ',' as usual. The reason is that th
### `admin-rotate-ssh-keys.sh` ### `admin-rotate-ssh-keys.sh`
Will create a new key and deploy on the server and move the PEM part to the local SSH folder. Will create a new key and deploy on the server and move the PEM part to the local SSH folder as defined in the `settings.ini` file `server_pem_folder` config setting and store the public keys in the `ssh-public-keys/admin-current` .
Folders are defined in the settings.ini Previous keys are moved to the`server_pem_archive_folder`
The old public keys are moved to the `ssh-public-keys/admin-previous` folder
Must have -g flag set to run Must have -g flag set to run
### `admin-remove-old-ssh-keys.sh` ### `admin-remove-old-ssh-keys.sh`
Will check in the previous ssh public key folder and remove this entry from the remote server Will check in the previous ssh public key folder `ssh-public-keys/admin-previous` and remove this entry from the remote server
Must have -g flag set to run Must have -g flag set to run
@@ -84,7 +90,9 @@ Options are
### `user-add-ssh-key.sh` ### `user-add-ssh-key.sh`
This script does not provide key, you need to provide a public key This script does not create a new private/public key set, you need to provide a public key
The public key must be put into the `ssh-public-keys/user-current` folder
Add a user public key to the admin user on a server Add a user public key to the admin user on a server
@@ -96,6 +104,8 @@ Add a user public key to the admin user on a server
### `user-remove-ssh-key.sh` ### `user-remove-ssh-key.sh`
To removed public keys must be located in the `ssh-public-keys/user-previous` folder
Remove a user public key from the admin user on a server Remove a user public key from the admin user on a server
- -h override single host name - -h override single host name

1
config/.gitignore vendored
View File

@@ -1,3 +1,4 @@
* *
!.gitignore !.gitignore
!settings.sample.ini !settings.sample.ini
!server_list.sample.csv

View File

@@ -0,0 +1,2 @@
Server,Username,Flag,Auth Key Settings
server ssh connect name,ssh connect admin name,NOT USED,ssh authorized file settings string
1 Server Username Flag Auth Key Settings
2 server ssh connect name ssh connect admin name NOT USED ssh authorized file settings string