sudo-prompt | command using sudo , prompting the user with an OS dialog | Speech library
kandi X-RAY | sudo-prompt Summary
kandi X-RAY | sudo-prompt Summary
Run a command using sudo, prompting the user with an OS dialog if necessary.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sudo-prompt
sudo-prompt Key Features
sudo-prompt Examples and Code Snippets
Community Discussions
Trending Discussions on sudo-prompt
QUESTION
Using rundeck. I created a node with the following settings:
...ANSWER
Answered 2021-Feb-08 at 21:15I did the same (passwordless sudo configuration) and works in this way.
- Node definition:
QUESTION
I'd like to import a cert (x509) to local keystore (win and macOS). With this electron app user can create a website locally and can enable HTTPS that's why we need to store the cert.
The issue:In some rare cases the user get an error message during cert import only on macOS:
Command failed: security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /Users/user/ssl/asdasd.local.crt SecTrustSettingsSetTrustSettings: The authorization was denied since no user interaction was possible.
If the user run the exact same command with sudo
in terminal it works as expected.
Note: All users who get this error message has enabled apple watch authentication, but we know a user who has also enabled apple watch auth end he didn't get error message.
What we do:In electron renderer process we run the following commands with sudo-prompt npm package. Every time first we delete the cert from keystore if it does exist and add the new one.
Windows add cert:
...ANSWER
Answered 2021-Jan-23 at 11:25I would suggest use a approach like below which will automatically ask for Admin access via GUI
QUESTION
I am on a small electron app right now that uses vue and typescript. When i run the app in dev mode, everything works fine, but when I build the app with electron builder some modules get lost somehow. In my case the modules adm-zip
and sudo-prompt
somehow vanish during the build. So when the app starts, i get an error on this lines const AdmZip = window.require('adm-zip');
I already tried to switch out the moduls with different ones, but that does not seem to matter. I guess it is a problem with webpack and typescript, but as I am not much of a webpack/electron guy, I surely miss something here. Other modules are working, like all the node stuff or the electron-store
module that I am also using.
Is this a common problem and do i have to import the modules differently somehow? Import
or the normal require
do not work, I always have to do the window.require
This would be the repo: https://github.com/w3champions/w3champions-launcher on branch AddLauncherStuff
...ANSWER
Answered 2020-Jul-27 at 11:22I executed "npm run build" with Admin privileges in Windows OS. Everything worked fine in my Windows.
I hope this article will help you.
QUESTION
I'm building a macOS app using Electron
I try to run the following command from the main process using ipcMain
and NodeJS's exec
.
ANSWER
Answered 2020-Jan-14 at 16:10The problem in cd
. Module sudo-prompt
redirect stderror to file. Just try to run like this example or add command for return back like cd ~/Library/Caches && du -sh * && cd ${process.cwd()}
QUESTION
I'm getting the following error whenever I try to run my app:
My package.json
:
ANSWER
Answered 2018-May-27 at 15:59Searching for that error led me here, which suggests that it's a problem in libuv
, an IO library used by Node. This issue is fixed in a later version of libuv, which is used by a later version of Node, which is used by a later version of Electron.
Updating to Electron 2.0 solves this issue.
QUESTION
I'm developing an Electron application, from which I need to install a dependency.
The package sudo-prompt ended up partly working.
My code:
ANSWER
Answered 2017-Oct-05 at 23:50Try it like this:
QUESTION
On occasion, the user initiates an action in my Node app that requires escalated administrator or root privileges. Rather than ask users to run the app with sudo
, I would like to prompt the user for their password and escalate the privileges of the already-running Node process.
I am not interested in my app executing a child process with sudo
(as is already possible with sudo-prompt). I want the node process itself to gain root privileges after having been started by a non-root user without sudo
.
One example of an app that displays behavior exhibiting the problem:
...ANSWER
Answered 2017-Jul-13 at 22:33Usually what you want to do is launch your server as root and then drop permissions, not the the other way around.
https://thomashunter.name/blog/drop-root-privileges-in-node-js/
If all you want to do is run on port 80 then that's what I recommend.
If you need permissions for other things you should probably have the user your server is running as have permission for those things. (write access to directories etc) Running as root is generally bad.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sudo-prompt
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page