Set up sesam user for SSH entry

This commit is contained in:
Stefan Haun 2022-07-23 16:34:13 +02:00
parent cf1fed21cb
commit 2b800e247c
2 changed files with 24 additions and 0 deletions

View 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

View file

@ -28,3 +28,20 @@
owner: root owner: root
group: root group: root
mode: '0644' 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