Set up sesam user for SSH entry
This commit is contained in:
parent
cf1fed21cb
commit
2b800e247c
2 changed files with 24 additions and 0 deletions
7
files/platon/sesam-door-open.sh
Executable file
7
files/platon/sesam-door-open.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "`date` : $SSH_KEY_OWNER" >> /home/sesam/door_open.log
|
||||
ssh pi@localhost -i /home/sesam/.ssh/id_rsa \
|
||||
-t /home/pi/sesame-open.sh
|
||||
|
||||
|
17
platon.yml
17
platon.yml
|
@ -28,3 +28,20 @@
|
|||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
### Sesam for SSH access
|
||||
#
|
||||
# Make sure to provide the .ssh/authorized_keys from backup, if needed
|
||||
|
||||
- name: Ensure sesam user is there
|
||||
ansible.builtin.user:
|
||||
name: sesam
|
||||
shell: /home/sesam/door-open.sh
|
||||
groups: i2c
|
||||
append: yes
|
||||
|
||||
- name: Copy door-open.ssh for sesam
|
||||
ansible.builtin.copy:
|
||||
src: files/platon/sesam-door-open.sh
|
||||
dest: /home/sesam/door-open.sh
|
||||
|
|
Loading…
Reference in a new issue