Created
September 14, 2022 02:40
anydesk installation + password set unattended (tested on Anydesk 6.2.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define desktop user name | |
UU=vagrant | |
rm -rf /home/$UU/.anydesk | |
rm -rf /etc/anydesk | |
apt purge anydesk | |
wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | apt-key add - | |
echo "deb http://deb.anydesk.com/ all main" > /etc/apt/sources.list.d/anydesk-stable.list | |
apt update | |
apt install anydesk | |
# repeat till it gets ONLINE, can take 30 seconds | |
while :; do ST=`anydesk --get-status`; echo $ST; echo $ST | grep -q online && break; sleep 2; done | |
PW=$(echo pw${RANDOM}pw${RANDOM}pw${RANDOM}pw) | |
ID=`anydesk --get-id` | |
echo -e "ad.security.allow_logon_token=true\nad.features.unattended=true" >> /home/$UU/.anydesk/user.conf | |
echo $PW | anydesk --set-password | |
# optional: | |
# sed -i '' -e 's/# AutomaticLogin/AutomaticLogin/g' -e 's/#WaylandEnable/WaylandEnable/g' /etc/gdm3/custom.conf | |
# reboot | |
echo -e "Anydesk for $HOSTNAME:\nID: $ID\nPW: $PW" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment