This website works better with JavaScript.
Home
Help
Sign In
LILiK
/
lilik_playbook
Watch
5
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
add last ssh logins to motd
python3
Edoardo Putti
7 years ago
parent
3245be02ea
commit
f68e03eb31
2 changed files
with
17 additions
and
3 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-0
files/last_ssh_login
+10
-3
roles/ssh_server/tasks/main.yaml
+ 7
- 0
files/last_ssh_login
View File
@ -0,0 +1,7 @@
#! /usr/bin/env bash
LOGINS=5
echo ""
echo "Last $LOGINS SSH accepted logins"
grep Accepted /var/log/auth.log | tail -n $LOGINS | cut -f 1,2,3,11,15,16,17,18,19,20,21,22 -d " "
+ 10
- 3
roles/ssh_server/tasks/main.yaml
View File
@ -1,10 +1,17 @@
# We can not use include_role here since it not share the connection with the current role
# We can not use include_role here since it not
# share the connection with the current role
---
-
include
:
roles/service/tasks/main.yaml
vars:
service_name
:
ssh
service_packages:
-
openssh-server
-
openssh-sftp-server
-
openssh-server
-
openssh-sftp-server
-
name
:
Add last logins to MOTD
file:
dest
:
/etc/update-motd.d/11-last-ssh-login
src
:
last_ssh_login
-
name
:
lookup user ca key
set_fact:
Write
Preview
Loading…
Cancel
Save