Honestpuck / homebrew.sh

Install homebrew via Jamf without giving users admin rights
Apache License 2.0
107 stars 30 forks source link

Cask Install - A terminal is required to read the password #14

Closed WejoPaulRigby closed 2 years ago

WejoPaulRigby commented 2 years ago

I'm trying to implement this with JAMF, running the [brew-install-cask.sh] with firefox for $4. I m getting the following result:

Script result: firefox is either not installed or not available. Attempting installation... Running brew update --preinstall... ==> Downloading https://download-installer.cdn.mozilla.net/pub/firefox/releases/97.0.1/mac/en-GB/Firefox%2097.0.1.dmg Already downloaded: /Users/username/Library/Caches/Homebrew/downloads/cb97158d02f3f6a6f6e1b9636ee904ee7734992fc488e2e9ef632cb1cfc73945--Firefox 97.0.1.dmg ==> Installing Cask firefox ==> Moving App 'Firefox.app' to '/Applications/Firefox.app' sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required Error: Failure while executing; /usr/bin/sudo -E -- /bin/mkdir -p /Applications exited with 1. Here's the output: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required ==> Purging files for version 97.0.1 of Cask firefox

Any ideas?

grahampugh commented 2 years ago

@WejoPaulRigby you'd have to raise the issue with whoever wrote the brew cask. This is not a problem with @Honestpuck's script.

magnusviri commented 2 years ago

@WejoPaulRigby you can configure sudo by editing /etc/sudoers to bypass the password. I don't have the details but I know it should be possible.

Honestpuck commented 2 years ago

@WejoPaulRigby Create a text file named after the user name and drop it in /private/etc/sudoers.d. The only line should read <name> ALL=(ALL) NOPASSWD:ALLwhere <name> is the user name. This allows sudo to be run by that user without it asking for a password. This is a huge security hole so once you've installed the cask you should delete the file. You might have to fiddle the permissions on the file, make them the same as /private/etc/sudo.

I'd raise a ticket with the cask author. They are doing something wrong. Alternately I'd use another method to install Firefox.