MacPorts shell mode

Rainer Müller raimue at macports.org
Thu Oct 19 16:39:09 UTC 2017


On 2017-10-19 18:25, -dan d. wrote:
> 
> I make an "mp" alias of the below which allows doing a port command without
> repeated sudo inputs.  In effect it puts your pasword into sudo for you:
> 
> echo your-password | /usr/bin/sudo -S port $1 $2 $3 $4 $5

Not a good idea. This means your password is in plain text on disk and
it will be visible to all users at runtime in the list of processes.

If you really want to run a command without typing your password,
configure the sudoers file accordingly. There are plenty of guides on
the web on how to do this, or see 'man sudoers' and 'man visudo'.

Be aware of the security implications such a configuration has. Allowing
to run port without sudo effectively allows to run any command as root,
as it is trivial to execute other binaries.

Rainer


More information about the macports-users mailing list