askpass

Automate non-interactive sudo operations using SUDO_ASKPASS with environment or file credentials.

Updated Jan 2, 2026
One-click install
npx skills add https://github.com/tanaka-mambinge/dotfiles --skill askpass
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: askpass
Source: https://github.com/tanaka-mambinge/dotfiles/tree/main/ai-configs/skills/askpass
Command: npx skills add https://github.com/tanaka-mambinge/dotfiles --skill askpass

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

SUDO_ASKPASS enables non-interactive sudo operations by providing a helper that supplies credentials when a password prompt would normally appear.

Core Features & Use Cases

  • Non-interactive elevation: Run sudo commands in scripts without manual prompts.
  • CI/CD and headless environments: Suitable for automated pipelines where TTY access is unavailable.
  • Flexible credential sources: Reads credentials from an environment variable or a file for automation.

Quick Start

Set the SUDO_ASKPASS environment variable to the path of the askpass.sh script and run sudo commands with -A.

Frequently Asked Questions about askpass

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run sudo commands in a script without a password prompt?

Non-interactive sudo uses a dedicated askpass helper script to supply credentials automatically. You set the SUDO_ASKPASS environment variable to the script path and run sudo with the -A flag.

What is SUDO_ASKPASS and how does it work for non-interactive sudo?

SUDO_ASKPASS is an environment variable pointing to a helper script that supplies passwords when sudo prompts. The askpass script reads credentials from environment variables or files and feeds them to sudo automatically.

Can I automate sudo in CI/CD pipelines where there is no TTY access?

Yes, non-interactive sudo is designed for CI/CD and headless environments without TTY access. The askpass helper supplies credentials from environment variables or files, bypassing interactive prompts entirely.

How do I set up the askpass helper for sudo -A in automation scripts?

Set the SUDO_ASKPASS environment variable to the path of your askpass.sh script, then run sudo commands with the -A flag. The script reads credentials from environment variables or a local file.

What happens when credentials are unavailable for non-interactive sudo?

When credentials are unavailable, the askpass helper gracefully declines and does not supply a password. This prevents hanging in automation scripts and allows error handling to proceed cleanly.

Does non-interactive sudo work with password files instead of environment variables?

Yes, the askpass helper reads credentials from either an environment variable or a local password file. This provides flexibility for different automation setups and security policies.