Skip to content

Password prompt for /etc/hosts setup is confusing #101

@bussyjd

Description

@bussyjd

Password prompt for /etc/hosts setup is confusing

Problem

During obolup.sh, users are prompted for a password to add obol.stack to /etc/hosts. The current wording is unclear:

[!] Administrator privileges required to update /etc/hosts

Please enter your password when prompted to add:
  127.0.0.1 obol.stack

Issues:

  1. Doesn't clearly state this is the system/sudo password (not a new password being created)
  2. Doesn't explain why we need it (to modify the protected /etc/hosts file)
  3. Users may be confused about what password to enter

Current Code

obolup.sh:1038-1043:

log_warn "Administrator privileges required to update /etc/hosts"
echo ""
echo "Please enter your password when prompted to add:"
echo "  $hosts_entry"
echo ""

Proposed Fix

Improve the wording to be more explicit:

log_warn "Administrator privileges required to update /etc/hosts"
echo ""
echo "You will be prompted for your system password (sudo) to add:"
echo "  $hosts_entry"
echo ""
echo "This is required to modify the protected /etc/hosts file."
echo ""

Or even simpler:

echo ""
echo "Administrator privileges required to add obol.stack to /etc/hosts"
echo ""
echo "You will be prompted for your system (sudo) password to add:"
echo "  $hosts_entry"
echo ""

Additional Context

This only affects users without passwordless sudo configured. Users with NOPASSWD sudo see:

[→] Updating /etc/hosts with existing privileges...

The confusion is specific to the password prompt scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions