This document covers the authentication methods and variables supported by the Claude Code VM deployment system as implemented in the Makefile.
VM_HOST- Target VM IP address or hostnameTARGET_USER- Username on target VM for deployment
VM_USER- SSH connection user (default:root)CONNECT_AS_TARGET- Connect directly as target user (default:false)
TARGET_SSH_KEY- Path to SSH private key (optional)USE_SSH_PASSWORD- Use password authentication (default:false)SSH_PASSWORD- SSH password (required when USE_SSH_PASSWORD=true)
USE_BECOME_PASSWORD- Require sudo password (default:false)BECOME_PASSWORD- Sudo password (required when USE_BECOME_PASSWORD=true)
Connect as root using SSH key, then configure target user.
make deploy VM_HOST=192.168.1.100 TARGET_USER=developerThis uses:
VM_USER=root(default)- SSH key authentication (system default key)
- Passwordless sudo
Connect directly as the target user.
make deploy VM_HOST=192.168.1.100 TARGET_USER=developer CONNECT_AS_TARGET=trueThis connects directly as developer without privilege escalation.
Use a specific SSH key for authentication.
make deploy VM_HOST=192.168.1.100 TARGET_USER=developer TARGET_SSH_KEY=~/.ssh/custom_keyUse password instead of SSH key.
make deploy VM_HOST=192.168.1.100 TARGET_USER=developer USE_SSH_PASSWORD=true SSH_PASSWORD=mypasswordRequire password for sudo operations.
make deploy VM_HOST=192.168.1.100 TARGET_USER=developer USE_BECOME_PASSWORD=true BECOME_PASSWORD=sudopassUse both SSH password and sudo password.
make deploy VM_HOST=192.168.1.100 TARGET_USER=developer \
USE_SSH_PASSWORD=true SSH_PASSWORD=sshpass \
USE_BECOME_PASSWORD=true BECOME_PASSWORD=sudopassConnect as non-root user with custom key and sudo password.
make deploy VM_HOST=192.168.1.100 VM_USER=admin TARGET_USER=developer \
TARGET_SSH_KEY=~/.ssh/admin_key \
USE_BECOME_PASSWORD=true BECOME_PASSWORD=adminpassKeep passwords out of command history by using environment variables:
export SSH_PASSWORD="mypassword"
export BECOME_PASSWORD="sudopassword"
make deploy VM_HOST=192.168.1.100 TARGET_USER=developer \
USE_SSH_PASSWORD=true USE_BECOME_PASSWORD=trueEnsure SSH private keys have correct permissions:
chmod 600 ~/.ssh/your_private_keyTest manual SSH connection:
ssh -i ~/.ssh/your_key user@hostUse the built-in connectivity test:
make test-connection VM_HOST=192.168.1.100 TARGET_USER=developerTest sudo access manually:
ssh user@host sudo whoamiEnable verbose Ansible output:
make deploy VM_HOST=192.168.1.100 TARGET_USER=developer -vvv- SSH Connection: Connect to
VM_HOSTasVM_USER(orTARGET_USERif CONNECT_AS_TARGET=true) - Authentication: Use SSH key (default) or password (if USE_SSH_PASSWORD=true)
- Privilege Escalation: Use sudo to execute tasks as
TARGET_USER(unless CONNECT_AS_TARGET=true) - Sudo Authentication: Passwordless (default) or with password (if USE_BECOME_PASSWORD=true)
This covers all authentication methods and variables actually implemented in the deployment system.