R
R
rec12122022-04-01 11:43:25
Command line
rec1212, 2022-04-01 11:43:25

How to run specific command without sudo password every time on mac os?

Greetings. Please tell me, when creating a text file-program in MAC OS (for example, BIG SUE), some (s) commands require superuser rights "sudo" (for example, changing the date and time). As a result, it takes time to constantly enter a password when starting a written program, we would like to avoid this. At the same time, I don’t want to allow ALL commands of the superuser sudo to be executed without a password, i.e. only a specific team(s) need to be granted such a right. Thank you to those who respond)
My specific situation is to make a (program) crutch that itself will rewind the date and time back, run the program I need with the completed trial, wait for a pause and, after, synchronize the time.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xotkot, 2022-04-01
@xotkot

add the necessary rules to /etc/sudoers
https://wiki.archlinux.org/title/Sudo#Example_entries

D
DevMan, 2022-04-01
@DevMan

- run as root, for which you have a separate console with root.
- edit sudoers
- use something like expect
- write a service
and many more options.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question