Use the --password option. Password Dialog

Use the --password option to create a password entry dialog.

The password entry dialog supports the following options:

<cmd>--username</cmd>

Display the username field.

The following example script shows how to create a password entry dialog:

#!/bin/sh ENTRY=`zenity --password --username` case $? in 0) echo "User Name: `echo $ENTRY | cut -d'|' -f1`" echo "Password : `echo $ENTRY | cut -d'|' -f2`" ;; 1) echo "Stop login.";; -1) echo "An unexpected error has occurred.";; esac
Password Entry Dialog Example Zenity password entry dialog example