Skip to content

Instantly share code, notes, and snippets.

@ezbik
Created September 14, 2022 02:40
Show Gist options
  • Save ezbik/4d43f66771aae9475ef7d36cc20a3aa0 to your computer and use it in GitHub Desktop.
Save ezbik/4d43f66771aae9475ef7d36cc20a3aa0 to your computer and use it in GitHub Desktop.
anydesk installation + password set unattended (tested on Anydesk 6.2.0)
# 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