AppVeyor starts every build on clean dedicated build worker VM. If you need to troubleshoot a broken build you can access running Linux VM via SSH with a full “root” access.
To enable SSH access during the build you should configure two environment variables (either in
appveyor.yml or on Environment tab of project settings):
APPVEYOR_SSH_KEY- public portion of your SSH key, for example
ssh-rsa AAAAB3NzaC1yc2EAAAABJQ...6TMCNw== rsa-key-20180328. This is mandatory variable.
APPVEYOR_SSH_BLOCK- if set to
trueSSH connection details will be displayed and the build will continue; otherwise SSH details will be displayed and the build will block until
~/build.lockis deleted. This variable is optional with with default value
Despite the fact
appveyor.ymlsettings takes over the UI environment variables are handled differently, i.e. environment variables defined on UI are getting merged with those one defined in
Add the following command at the place where SSH access should be enabled:
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
For example, to enable SSH access at the very beginning of the build, during
init: - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e - environment: APPVEYOR_SSH_KEY: <ssh public key> APPVEYOR_SSH_BLOCK: true
SSH session is limited by allotted build time.
ssh-keygen is available on Linux (Windows Subsystem for Linux on Windows 10) and it comes bundled with Git for Windows and usually located at
The following command generates 2048-bit RSA key and saves its private and public keys into
C:\MyProjects\ssh-key.key.pub files respectively:
"C:\Program Files\Git\usr\bin\ssh-keygen.exe" -t rsa -b 2048 -N "" -C appveyor -f /c/MyProjects/ssh-key.key
You can generate SSH key using “PuTTYgen” GUI tool which is a part of PuTTY - a free SSH client for Windows. To start PuTTYgen click Windows start menu and type
PuTTYgen. Configure the following parameters:
Click Generate button then save both public and private keys.