![]() You can find my homeAssistant setup right here on GitHub. To simplify your life, set up a sshconfig file. Same for when running on a different port, specify it together with -p. In case you use an alternative identity file, you can provide that with the -i option. That’s about it: Hope you find it useful! It will use your local environment to determine the related key(s) and copy it over. ![]() Turn_off_defiant: 'ssh -o UserKnownHostsFile=/config/.ssh/knownhosts -o StrictHostKe圜hecking=no -i /config/.ssh/id_rsa sudo shutdown -Ph now' In the following example we setup a shell_command which actually issues the command to the entity, using ssh a Switch, which invokes the ' shell_command and an Automation that uses the Switch… In this case, as we are connecting as root we can issue any command we like from home assistant. If everything worked then you should get an ssh connection to 192.168.1.185 Therefore, I copied '/.ssh' folder from host to container in each host. In three host: ssh-keygen Then, for each slave, I ran this command in Master: ssh-copy-id userip I tested that ssh works without password between Master and slaves. Now try logging into the machine, with ssh like this I did these stages: First, I made ssh passwordless among three hosts. Note: You may wish to use a different user (not root) in my case I wish root access to the device This command establishes trust between the server (192.168.1.185) and any SSH Client connecting to the server, using these keys to authenticate. How can I make ssh-copy-id use a port other than 22 I tried it with -p but I get: ssh-copy-id -p XXX XXXXXX.XX.XX.XX Bad port 'umask 077 test -d /.ssh mkdir /.ssh cat > /.ssh/authorizedkeys' I know that the port is good because I'm connected to the server on that port. Next Copy your keys to the target server(s) ie for 192.168.1.185: Your public key has been saved in /root/.ssh/id_rsa.pub.Īuthorized_keys id_rsa id_rsa.pub known_hosts8 To work with the SSH client programs ssh and scp, a server (the SSH daemon) must be running in the background, listening for connections on TCP/IP port 22. It can be determined by using command ifconfig. Do not forget to replace IPADDRESS with the actual LAN IP address of your device. Now do: ssh-copy-id -p 8022 -i idrsa IPADDRESS. Your identification has been saved in /root/.ssh/id_rsa. Password authentication has to be enabled in order to install pubkey on remote machine. Response: Generating public/private rsa key pair.Įnter file in which to save the key (/root/.ssh/id_rsa):Įnter passphrase (empty for no passphrase): I always find setting up control of devices with Hassio, using SSH a little difficult to remember and I thought it might be useful to someone (and me the next time I need to do it) if I posted a complete guide.įrom hassio (terminal), change to the config directory, Generate a passphraseless SSH key and push it to entity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |