* Re: equivalent to su or sudo?
2018-08-17 13:08 equivalent to su or sudo? Ulli Horlacher
@ 2018-08-17 13:36 ` john doe
2018-08-17 14:36 ` Ulli Horlacher
2018-08-17 17:15 ` Andrey Repin
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: john doe @ 2018-08-17 13:36 UTC (permalink / raw)
To: cygwin
On 8/17/2018 12:01 PM, Ulli Horlacher wrote:
> I need to run some scripts with full administrator rights (for chown,
> chmod, setfacl).
> Is there a cygwin equivalent to su or sudo?
>
https://stackoverflow.com/questions/4090301/root-user-sudo-equivalent-in-cygwin
--
John Doe
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: equivalent to su or sudo?
2018-08-17 13:08 equivalent to su or sudo? Ulli Horlacher
2018-08-17 13:36 ` john doe
@ 2018-08-17 17:15 ` Andrey Repin
2018-08-17 18:55 ` Achim Gratz
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Andrey Repin @ 2018-08-17 17:15 UTC (permalink / raw)
To: Ulli Horlacher, cygwin
Greetings, Ulli Horlacher!
> I need to run some scripts with full administrator rights (for chown,
> chmod, setfacl).
> Is there a cygwin equivalent to su or sudo?
If by that you mean "run privileged program inside a user terminal", no.
This is inherently insecure and not supported under Windows.
--
With best regards,
Andrey Repin
Friday, August 17, 2018 18:21:00
Sorry for my terrible english...
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: equivalent to su or sudo?
2018-08-17 13:08 equivalent to su or sudo? Ulli Horlacher
2018-08-17 13:36 ` john doe
2018-08-17 17:15 ` Andrey Repin
@ 2018-08-17 18:55 ` Achim Gratz
2018-08-18 3:50 ` David Rothenberger
2018-09-30 14:40 ` Erik Soderquist
4 siblings, 0 replies; 8+ messages in thread
From: Achim Gratz @ 2018-08-17 18:55 UTC (permalink / raw)
To: cygwin
Ulli Horlacher writes:
> I need to run some scripts with full administrator rights (for chown,
> chmod, setfacl).
Whatever runs these scripts must already have aquired administrative
rights.
> Is there a cygwin equivalent to su or sudo?
No, you can only start out with administrative rights and then drop them
when no longer needed (cygdrop --help).
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: equivalent to su or sudo?
2018-08-17 13:08 equivalent to su or sudo? Ulli Horlacher
` (2 preceding siblings ...)
2018-08-17 18:55 ` Achim Gratz
@ 2018-08-18 3:50 ` David Rothenberger
2018-08-18 14:28 ` cyg Simple
2018-09-30 14:40 ` Erik Soderquist
4 siblings, 1 reply; 8+ messages in thread
From: David Rothenberger @ 2018-08-18 3:50 UTC (permalink / raw)
To: cygwin
Ulli Horlacher wrote:
> I need to run some scripts with full administrator rights (for chown,
> chmod, setfacl).
> Is there a cygwin equivalent to su or sudo?
>
I use the following shell script to start a command as Administrator. I mainly just use it to start mintty.
#!/bin/bash
cmd="$(cygpath -da "$1")"; shift
if [ $# -gt 0 ]; then
powershell Start-Process "$cmd" -ArgumentList \""$@"\" -Verb RunAs -WindowStyle Hidden
else
powershell Start-Process "$cmd" -Verb RunAs -WindowStyle Hidden
fi
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: equivalent to su or sudo?
2018-08-18 3:50 ` David Rothenberger
@ 2018-08-18 14:28 ` cyg Simple
0 siblings, 0 replies; 8+ messages in thread
From: cyg Simple @ 2018-08-18 14:28 UTC (permalink / raw)
To: cygwin
On 8/17/2018 4:33 PM, David Rothenberger wrote:
> Ulli Horlacher wrote:
>> I need to run some scripts with full administrator rights (for chown,
>> chmod, setfacl).
>> Is there a cygwin equivalent to su or sudo?
>>
>
> I use the following shell script to start a command as Administrator. I mainly just use it to start mintty.
>
> #!/bin/bash
> cmd="$(cygpath -da "$1")"; shift
> if [ $# -gt 0 ]; then
> powershell Start-Process "$cmd" -ArgumentList \""$@"\" -Verb RunAs -WindowStyle Hidden
> else
> powershell Start-Process "$cmd" -Verb RunAs -WindowStyle Hidden
> fi
>
You don't need powershell for that.
<file name="/usr/local/bin/runas">
#!/bin/sh
export PS1="% "
cygstart --action=runas mintty --title=Admin -e /bin/bash -il
</file>
The export of PS1 is to mark that the terminal window is in
administrative rights. You can modify the shell program to dash, ash
zsh or whatever you favorite shell is. Make sure to issue the
interactive and login support for the shell.
--
cyg Simple
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: equivalent to su or sudo?
2018-08-17 13:08 equivalent to su or sudo? Ulli Horlacher
` (3 preceding siblings ...)
2018-08-18 3:50 ` David Rothenberger
@ 2018-09-30 14:40 ` Erik Soderquist
4 siblings, 0 replies; 8+ messages in thread
From: Erik Soderquist @ 2018-09-30 14:40 UTC (permalink / raw)
To: cygwin
On Fri, Aug 17, 2018 at 6:01 AM, Ulli Horlacher wrote:
> I need to run some scripts with full administrator rights (for chown,
> chmod, setfacl).
> Is there a cygwin equivalent to su or sudo?
I've actually found that after installing and configuring sshd as a
service, "ssh localhost" gives me an elevated shell without any hassle
(I'm part of the local admins group; you may have to modify to "ssh
admin@localhost"). If you want to use this as a replacement for
'sudo' without having ssh open to the network, modify your sshd
configuration to only accept localhost connections and as an added
layer, make sure your firewall denies all incoming network traffic to
sshd
-- Erik
--
"I do not think any of us are truly sane, Caleb. Not even you. Courage
is not sanity. Being willing to die for someone else is not sanity."
... "Love is not sane, nor is faith." ... "If sanity lacks those
things, Caleb, I want no part of it."
-- Alexandria Terri in "Weaving the Wyvern" by Alexis Desiree Thorne
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread