{"id":23777614,"url":"https://github.com/1999azzar/passwordless_sudo","last_synced_at":"2026-05-18T04:44:59.027Z","repository":{"id":270314104,"uuid":"909981213","full_name":"1999AZZAR/passwordless_sudo","owner":"1999AZZAR","description":"This guide explains how to safely configure passwordless sudo access for a user on Linux systems.","archived":false,"fork":false,"pushed_at":"2024-12-30T07:52:25.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T13:13:18.711Z","etag":null,"topics":["linux","passwordless","sudo"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1999AZZAR.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-30T07:50:27.000Z","updated_at":"2024-12-30T07:59:50.000Z","dependencies_parsed_at":"2024-12-31T22:54:39.907Z","dependency_job_id":null,"html_url":"https://github.com/1999AZZAR/passwordless_sudo","commit_stats":null,"previous_names":["1999azzar/passwordless_sudo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1999AZZAR/passwordless_sudo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fpasswordless_sudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fpasswordless_sudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fpasswordless_sudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fpasswordless_sudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1999AZZAR","download_url":"https://codeload.github.com/1999AZZAR/passwordless_sudo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fpasswordless_sudo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273067817,"owners_count":25039908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","passwordless","sudo"],"created_at":"2025-01-01T08:47:48.872Z","updated_at":"2026-05-18T04:44:58.966Z","avatar_url":"https://github.com/1999AZZAR.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configuring Passwordless sudo in Linux - Complete Guide\n\nThis guide explains how to configure passwordless `sudo` access for a user on Linux systems, either manually or using our automated script.\n\n## Table of Contents\n- [Automated Configuration](#automated-configuration)\n- [Manual Configuration](#manual-configuration)\n- [Security Considerations](#security-considerations)\n- [Troubleshooting](#troubleshooting)\n- [Advanced Configuration](#advanced-configuration)\n\n## Automated Configuration\n\n### Using the Setup Script\n\n1. Download the configuration script:\n   ```bash\n   curl -O https://raw.githubusercontent.com/1999azzar/passwordless_sudo/master/passwordless_sudo.sh\n   ```\n\n2. Make it executable:\n   ```bash\n   chmod +x passwordless_sudo.sh\n   ```\n\n3. Run the script:\n   ```bash\n   # Configure for current user\n   sudo ./passwordless_sudo.sh\n\n   # OR configure for specific user\n   sudo ./passwordless_sudo.sh username\n   ```\n\n### Script Features\n- Automatic user detection\n- Comprehensive safety checks\n- Automatic backup of existing configuration\n- Detailed logging\n- Configuration testing\n- Security settings (session timeout, command logging)\n\n## Manual Configuration\n\nIf you prefer to configure passwordless sudo manually, follow these steps:\n\n### Prerequisites\n- Root or sudo access on the system\n- Username for configuration\n- Basic familiarity with terminal commands\n\n### Step 1: Create Custom Sudoers File\n\n```bash\nsudo -e /etc/sudoers.d/nopasswd-users\n```\n\nAdd your configuration:\n```bash\n# Replace 'username' with your actual username\nusername ALL=(ALL) NOPASSWD: ALL\n```\n\n### Step 2: Set Correct Permissions\n\n```bash\nsudo chmod 440 /etc/sudoers.d/nopasswd-users\nsudo chown root:root /etc/sudoers.d/nopasswd-users\n```\n\n### Step 3: Verify Configuration\n\n```bash\n# Check syntax\nsudo visudo -c\n\n# Test sudo access\nsudo ls /root\n```\n\n## Security Considerations\n\n⚠️ **Important Security Notice**\n- Passwordless sudo reduces system security\n- Only implement on trusted systems\n- Consider using command-specific permissions instead of full access\n- Regularly audit sudo configurations\n- Monitor sudo usage logs\n\n### Recommended Security Settings\n\n1. **Limited Command Access**\n   ```bash\n   username ALL=(ALL) NOPASSWD: /usr/bin/apt, /sbin/reboot\n   ```\n\n2. **Session Timeout**\n   ```bash\n   Defaults:username timestamp_timeout=30\n   ```\n\n3. **Command Logging**\n   ```bash\n   Defaults:username logfile=\"/var/log/sudo_username.log\"\n   ```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Password Still Required**\n   - Check file permissions\n   - Verify syntax\n   - Look for conflicting rules\n\n2. **Permission Denied**\n   ```bash\n   sudo chmod 440 /etc/sudoers.d/nopasswd-users\n   sudo chown root:root /etc/sudoers.d/nopasswd-users\n   ```\n\n3. **Configuration Not Working**\n   - Check logs: `sudo tail -f /var/log/auth.log`\n   - List sudo rules: `sudo -l`\n   - Verify syntax: `sudo visudo -c`\n\n## Advanced Configuration\n\n### Command Aliases\n```bash\n# In /etc/sudoers.d/nopasswd-users\nCmnd_Alias SYSTEM_COMMANDS = /usr/bin/apt, /sbin/reboot, /usr/bin/systemctl\nusername ALL=(ALL) NOPASSWD: SYSTEM_COMMANDS\n```\n\n### User Groups\n```bash\n# Allow all developers passwordless access to specific commands\n%developers ALL=(ALL) NOPASSWD: SYSTEM_COMMANDS\n```\n\n### Logging Configuration\n```bash\n# Enhanced logging\nDefaults:username log_output\nDefaults:username logfile=\"/var/log/sudo_username.log\"\nDefaults:username log_year\nDefaults:username loglinelen=0\n```\n\n## Reverting Changes\n\n### Using the Script\n```bash\nsudo rm /etc/sudoers.d/nopasswd-username\n```\n\n### Manual Reversion\n1. Remove custom configuration:\n   ```bash\n   sudo rm /etc/sudoers.d/nopasswd-users\n   ```\n\n2. Or comment out specific lines:\n   ```bash\n   sudo -e /etc/sudoers.d/nopasswd-users\n   # Comment out the NOPASSWD line:\n   # username ALL=(ALL) NOPASSWD: ALL\n   ```\n\n## Best Practices\n\n1. Use separate files in `/etc/sudoers.d/` instead of editing main sudoers file\n2. Implement specific command allowances rather than full access\n3. Regular security audits\n4. Maintain configuration backups\n5. Document all changes\n6. Monitor sudo usage logs\n\n## Support\n\nFor additional help:\n- System logs: `sudo tail -f /var/log/auth.log`\n- Sudo manual: `man sudo`\n- Sudoers manual: `man sudoers`\n- Distribution documentation\n\n## Contributing\n\nFeel free to submit issues and enhancement requests!\n\n---\n\n**Note**: This guide and associated script are provided as-is. Always test in a safe environment first.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fpasswordless_sudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1999azzar%2Fpasswordless_sudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fpasswordless_sudo/lists"}