-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible: SSH into shell servers as root #44
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a209998
doc: Unify docs for blocking users
KellerFuchs 5400520
Add a playbook for blocking users
KellerFuchs c9bea91
gitignore *.retry files
KellerFuchs 61a992e
shell: Allow more parallelism in the playbook
KellerFuchs 5247012
irc: Allow parallel execution
KellerFuchs eecc5aa
credentials: Allow parallel run of the roles
KellerFuchs 0555e39
hosts: SSH into shell servers as root
KellerFuchs 028609d
Remove spurious `become`s in playbooks
KellerFuchs 5b1dc5f
vault: Update VAULT_FILES list
KellerFuchs 143040a
Merge branch 'gitignore-retry'
KellerFuchs 58ced8f
Merge branch 'parallel'
KellerFuchs c3b86c1
Merge branch 'ldap_ban'
KellerFuchs 6d1b642
Merge branch 'shell-root'
KellerFuchs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.vault_newpassphrase.pgp | ||
*.retry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$ANSIBLE_VAULT;1.1;AES256 | ||
34306139353035626239353739643532323431393635336566306533613635663433386132643237 | ||
6564306336326135303234393065336335613265323434610a326632643533633334626437313234 | ||
34393962316163366536616632663432393763313034616637653533386332623036313865633832 | ||
6566316434643762390a353638663966393132343634653163366163306336663062313231613934 | ||
30353766626533333862376230343230616162333138383735313534373038623136616236306531 | ||
32313861643032353764386362313232633533326465646537383864383335613232386261363935 | ||
64666637316463663363636534613166313961393263333565343438373633653061646263316463 | ||
36666335653161666662623732303162656464363336636638366566343331356131393234316231 | ||
35316233613266353135393630346138363139633062373032383835303034366538 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
# This is a sucky way to make LDAP changes, | ||
# but Ansible's ldap_attr module is v2.3 only | ||
- hosts: ldap.hashbang.sh | ||
become: false | ||
vars: | ||
ldif: | | ||
dn: uid={{ user }},ou=People,dc=hashbang,dc=sh | ||
changetype: modify | ||
replace: loginShell | ||
loginShell: /usr/sbin/nologin | ||
|
||
tasks: | ||
- name: Disable account in LDAP | ||
shell: echo "{{ ldif }}" | docker exec -i slapd ldapmodify -D {{ ldap.user }} -w {{ ldap.password }} | ||
|
||
- hosts: shell_servers | ||
become: true | ||
strategy: free | ||
tasks: | ||
- name: Invalidate SSSd cache for {{ user }} | ||
command: sss_cache -u {{ user }} | ||
changed_when: false | ||
|
||
- name: Terminate sessions for {{ user }} | ||
command: loginctl terminate-user {{ user }} | ||
register: terminate | ||
failed_when: | | ||
'Could not terminate user: No user' not in terminate.stderr | ||
and terminate|failed | ||
changed_when: terminate.stderr == "" and terminate|success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a link to issue 74 in a comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arg. Will do... in a separate PR? :V
In general, though, there is no benefit not to do this: direct root isn't any more privileged than admin+sudo, and this avoids the dependency on LDAP/userdb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I like to disable root login via sshd. I'd like to do that for hashbang too but... this. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eeeh, experience (#! and otherwise) says that having a method of getting root without relying on LDAP is good :3