![]() Therefore we need to copy the ssh keys to the configuration folder. the shell_command integration we will use later. Our keys created in 3 are not accessible by other integration e.g. Now you should be able to login to the disktation from the Home Assistant shell without entering a password e.g.$diskstation: chmod 0600 ~/.ssh/authorized_keys.Next we need to set the correct permission for the folder & files on the diskstation ssh/id_rsa.pub this adds your public key to the authorized_keys file on your dikstation make sure your private (id_rsa) and public key (id_rsa_pub) are generated in ls ~/.ssh. ![]() $homeassistant: ssh-keygen -t rsa -b 4096 -C do NOT set a password.If not already done configure SSH-Server Addon.Now we want to ssh into the dikstation from Home Assistant. ![]() Create keys on your Home Assistant device (e.g. This will allow the user home_assistant_ssh to execute the poweroff command without entering a password. Therefore we add following line to the end of /etc/sudoers: home_assistant_ssh ALL=NOPASSWD: /sbin/poweroff When we run this command later using a script we cannot enter the password. If you ssh with the new user to your diskstation and run it you would be asked to enter your password before the command is executed. To shutdown the diskstation we use the command sudo poweroff.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |