Difference between revisions of "Linux: Setting up a call home function"
Jump to navigation
Jump to search
| (4 intermediate revisions by the same user not shown) | |||
| Line 9: | Line 9: | ||
[Service] | [Service] | ||
Type=idle | Type=idle | ||
| − | ExecStart=/usr/bin/ssh -o | + | ExecStart=/usr/bin/ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure=yes" -N -R 2233:localhost:22 rsupport@jumpbox.define-technology.com |
ExecReload=/bin/kill -HUP $MAINPID | ExecReload=/bin/kill -HUP $MAINPID | ||
KillMode=process | KillMode=process | ||
| Line 17: | Line 17: | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | Start and enable the service on reboot | ||
| + | |||
| + | <syntaxhighlight> | ||
| + | systemctl daemon-reload | ||
| + | systemctl enable callhome | ||
| + | systemctl start callhome | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | <pre> | ||
| + | # if you need to copy out a public key from anydesk or some other crap Remote Desktop app | ||
| + | Create a cl1p example: | ||
| + | curl -H "Content-Type: text/html; charset=UTF-8" -X POST --data "`cat ~/.ssh/id_rsa.pub`" https://api.cl1p.net/dp-pubkey | ||
| + | |||
| + | View a cl1p example: | ||
| + | curl https://api.cl1p.net/dp-pubkey | ||
| + | </pre> | ||
Latest revision as of 16:07, 16 February 2023
File: /etc/systemd/system/callhome.service # Mode 644.
[Unit]
Description=callhome
Documentation=man:ssh
After=network-online.target
[Service]
Type=idle
ExecStart=/usr/bin/ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o "ExitOnForwardFailure=yes" -N -R 2233:localhost:22 rsupport@jumpbox.define-technology.com
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=57s
[Install]
WantedBy=multi-user.targetStart and enable the service on reboot
systemctl daemon-reload
systemctl enable callhome
systemctl start callhome# if you need to copy out a public key from anydesk or some other crap Remote Desktop app Create a cl1p example: curl -H "Content-Type: text/html; charset=UTF-8" -X POST --data "`cat ~/.ssh/id_rsa.pub`" https://api.cl1p.net/dp-pubkey View a cl1p example: curl https://api.cl1p.net/dp-pubkey