22
22
23
23
- Prepare [ Central Configuration] ( #central-configuration ) once
24
24
- Add new servers by:
25
- - Complete [ Server Configuration] ( #server-configuration )
26
- - [ Install] ( #installation ) the service
25
+ - Complete [ Server Configuration] ( #server-configuration )
26
+ - [ Install] ( #installation ) the service
27
27
28
28
* It is strongly recommended updating the service once in a while*
29
29
102
102
103
103
1 . Create a local configuration file ` /root/ssh-manager.yml `
104
104
105
- ``` yaml
106
- secret_name : ssh-manager
107
- region : us-west-1
108
- groups :
109
- - devops
110
- - poc
111
- ` ` `
105
+ ``` yaml
106
+ secret_name : ssh-manager
107
+ region : us-west-1
108
+ groups :
109
+ - devops
110
+ - poc
111
+ ` ` `
112
112
113
- - ` secret_name` (required) - AWS Secret name with a central configuration
114
- - ` region` - AWS region where a Secret is stored. Default **us-east-1**
115
- - ` groups` (required) - a list of server group names from a central configuration
113
+ - ` secret_name` (required) - AWS Secret name with a central configuration
114
+ - ` region` - AWS region where a Secret is stored. Default **us-east-1**
115
+ - ` groups` (required) - a list of server group names from a central configuration
116
116
117
117
2. Create and attach an IAM Roles or configure an IAM User to allow EC2's to fetch the secret.
118
118
- If using User Authentication, configure the credentials for root user.
@@ -128,39 +128,39 @@ groups:
128
128
- Download latest [release](https://github.com/ReasonSoftware/ssh-manager/releases/latest) unzip to `/var/lib/ssh-manager`
129
129
- Create **systemd** service under `/etc/systemd/system/ssh-manager.service` with the following content :
130
130
131
- ` ` `
132
- [Unit]
133
- Description=Central SSH Management Service for AWS Linux EC2
134
- Wants=network-online.target
135
- After=network-online.target
136
-
137
- [Service]
138
- Type=oneshot
139
- ExecStart=/var/lib/ssh-manager/ssh-manager
140
- StandardOutput=journal
141
- User=root
142
-
143
- [Install]
144
- WantedBy=multi-user.target
145
- ` ` `
131
+ ` ` `
132
+ [Unit]
133
+ Description=Central SSH Management Service for AWS Linux EC2
134
+ Wants=network-online.target
135
+ After=network-online.target
136
+
137
+ [Service]
138
+ Type=oneshot
139
+ ExecStart=/var/lib/ssh-manager/ssh-manager
140
+ StandardOutput=journal
141
+ User=root
142
+
143
+ [Install]
144
+ WantedBy=multi-user.target
145
+ ` ` `
146
146
147
147
- Create **systemd** timer under `/etc/systemd/system/ssh-manager.timer` with the following content :
148
148
149
- ` ` `
150
- [Unit]
151
- Description=Timer for Central SSH Management Service
152
- Wants=network-online.target
153
- After=network-online.target
154
-
155
- [Timer]
156
- Unit=ssh-manager.service
157
- OnBootSec=10min
158
- OnUnitInactiveSec=60min
159
- Persistent=true
160
-
161
- [Install]
162
- WantedBy=multi-user.target
163
- ` ` `
149
+ ` ` `
150
+ [Unit]
151
+ Description=Timer for Central SSH Management Service
152
+ Wants=network-online.target
153
+ After=network-online.target
154
+
155
+ [Timer]
156
+ Unit=ssh-manager.service
157
+ OnBootSec=10min
158
+ OnUnitInactiveSec=60min
159
+ Persistent=true
160
+
161
+ [Install]
162
+ WantedBy=multi-user.target
163
+ ` ` `
164
164
165
165
- Reload **systemd** configuration : ` systemctl daemon-reload`
166
166
- Enable **ssh-manager** service : ` systemctl enable ssh-manager.service`
@@ -180,18 +180,18 @@ Decide what are you going to do with the users and either delete them (`userdel
180
180
181
181
- Delete systemd service and timer :
182
182
183
- ` ` ` shell
184
- systemctl stop ssh-manager.service
185
- systemctl stop ssh-manager.timer
186
- rm -f /etc/systemd/system/ssh-manager.*
187
- ` ` `
183
+ ` ` ` shell
184
+ systemctl stop ssh-manager.service
185
+ systemctl stop ssh-manager.timer
186
+ rm -f /etc/systemd/system/ssh-manager.*
187
+ ` ` `
188
188
189
189
- Delete application groups :
190
190
191
- ` ` ` shell
192
- groupdel ssh-manager-users
193
- groupdel ssh-manager-sudoers
194
- ` ` `
191
+ ` ` ` shell
192
+ groupdel ssh-manager-users
193
+ groupdel ssh-manager-sudoers
194
+ ` ` `
195
195
196
196
- Remove `%ssh-manager-sudoers ALL=(ALL) NOPASSWD : ALL` entry from `/etc/sudoers` file
197
197
- Delete app directory `rm -rf /var/lib/ssh-manager`
0 commit comments