I am trying to push changes to a remote repository on Github from Qt Creator, but it fails with
21:03 Running in /Users/.../...: /usr/bin/git push
129:328: execution error: Can’t get application missing value of «script». (-1728)
error: unable to read askpass response from '/usr/libexec/ssh-askpass'
fatal: could not read Username for 'https://github.com': Device not configured
The command "/usr/bin/git" terminated with exit code 128.
21:03 Running in /Users/.../...: /usr/bin/git push
129:328: execution error: Can’t get application missing value of «script». (-1728)
error: unable to read askpass response from '/usr/libexec/ssh-askpass'
fatal: could not read Username for 'https://github.com': Device not configured
The command "/usr/bin/git" terminated with exit code 128.
To copy to clipboard, switch view to plain text mode
I am using a MacBook with macOS Sierra 10.12.6. The procedure works perfectly on my iMac (desktop) running the same OS.
For some reason the MacBook as supplied does not have ssh-askpass installed, so I installed it following the instructions at https://github.com/markcarver/mac-ssh-askpass. This installs the following AppleScript code in /usr/libexec/:
#!/bin/bash
# Script: ssh-askpass
# Author: Mark Carver
# Created: 2011-09-14
# Licensed under GPL 3.0
# A ssh-askpass command for Mac OS X
# Based from author: Joseph Mocker, Sun Microsystems
# http://blogs.oracle.com/mock/entry/and_now_chicken_of_the
# To use this script:
# Install this script running INSTALL as root
#
# If you plan on manually installing this script, please note that you will have
# to set the following variable for SSH to recognize where the script is located:
# export SSH_ASKPASS="/path/to/ssh-askpass"
TITLE="${SSH_ASKPASS_TITLE:-SSH}";
TEXT="$(whoami)'s password:";
IFS=$(printf "\n");
CODE=("on GetCurrentApp()");
CODE=(${CODE[*]} "tell application \"System Events\" to get short name of first process whose frontmost is true");
CODE=(${CODE[*]} "end GetCurrentApp");
CODE=(${CODE[*]} "tell application GetCurrentApp()");
CODE=(${CODE[*]} "activate");
CODE=(${CODE[*]} "display dialog \"${@:-$TEXT}\" default answer \"\" with title \"${TITLE}\" with icon caution with hidden answer");
CODE=(${CODE[*]} "text returned of result");
CODE=(${CODE[*]} "end tell");
SCRIPT="/usr/bin/osascript"
for LINE in ${CODE[*]}; do
SCRIPT="${SCRIPT} -e $(printf "%q" "${LINE}")";
done;
eval "${SCRIPT}";
#!/bin/bash
# Script: ssh-askpass
# Author: Mark Carver
# Created: 2011-09-14
# Licensed under GPL 3.0
# A ssh-askpass command for Mac OS X
# Based from author: Joseph Mocker, Sun Microsystems
# http://blogs.oracle.com/mock/entry/and_now_chicken_of_the
# To use this script:
# Install this script running INSTALL as root
#
# If you plan on manually installing this script, please note that you will have
# to set the following variable for SSH to recognize where the script is located:
# export SSH_ASKPASS="/path/to/ssh-askpass"
TITLE="${SSH_ASKPASS_TITLE:-SSH}";
TEXT="$(whoami)'s password:";
IFS=$(printf "\n");
CODE=("on GetCurrentApp()");
CODE=(${CODE[*]} "tell application \"System Events\" to get short name of first process whose frontmost is true");
CODE=(${CODE[*]} "end GetCurrentApp");
CODE=(${CODE[*]} "tell application GetCurrentApp()");
CODE=(${CODE[*]} "activate");
CODE=(${CODE[*]} "display dialog \"${@:-$TEXT}\" default answer \"\" with title \"${TITLE}\" with icon caution with hidden answer");
CODE=(${CODE[*]} "text returned of result");
CODE=(${CODE[*]} "end tell");
SCRIPT="/usr/bin/osascript"
for LINE in ${CODE[*]}; do
SCRIPT="${SCRIPT} -e $(printf "%q" "${LINE}")";
done;
eval "${SCRIPT}";
To copy to clipboard, switch view to plain text mode
To do this I had to disable SIP (restart in recovery mode and execute 'csrutil disable' from the terminal). I then changed the permissions on the ssh-askpass file to make it executable, stored its path (/usr/libexec/ssh-askpass) in Qt Creator > Preferences > Version Control, and for good measure added the 'export SSH_ASKPASS' setting to my .bash_profile as recommended.
I checked the installation by running ssh-askpass from the command line and it behaves correctly, requesting and then returning a password. However, when it is invoked from the Qt Creator menu (Tools > Git > Remote Repository > Push) in fails as described above.
I would be very grateful for any help with this.
Bookmarks