This is something that seems to be the case on vi and emacs too, I have never seen a unix program which prompts me for sudo password at the moment that it needs to do a privileged operation rather than requiring running via sudo.
On emacs, you can C-x C-f /sudo://etc/hosts and it'll do what you think that means, including prompting for your password only once in $TIMEOUT. It's the same base mechanism that lets you C-x C-f /user@host:path for remote editing through ssh.
When I vi a read-only file:
"/etc/mail/aliases" [Read only] 36 lines, 1023 characters
Its simply a matter of remaining keen when doing admin tasks. Sure I have to close/re-open with sudo but its prompting me up front that I won't be able to save it.> Sure I have to close/re-open with sudo but its prompting me up front that I won't be able to save it.
No, you don't, and yes, you will:
:w !sudo tee %
Re:The security hole in sudo
by FuzzyDunlop on Wednesday May 23, 2012 @12:15PM
(#4013749)
You can do something like this instead (IIRC):
:w !sudo tee % > /dev/null
It's a bit of a hack, but it works.I have, but it was a patched version.
I think there's a sense, which I generally agree with, that random applications asking for your password is something we don't want users to get used to.
Re:The security hole in sudo
by TazeTSchnitzel on Wednesday May 23, 2012 @11:27AM
(#4013517)
Windows hasn't been "administrator by default" since Vista.
It's still administrator by default, they just prompt you to click ok on every administrative action, something users still do blindly.
Re:The security hole in sudo
by TazeTSchnitzel on Wednesday May 23, 2012 @11:51AM
(#4013636)
And Ubuntu users don't blindly enter their passwords at gksudo prompts?
Huge difference between hitting OK and typing the admin password.
Re:The security hole in sudo
by TazeTSchnitzel on Wednesday May 23, 2012 @05:08PM
(#4015310)
Really? Both are pretty instinctive to me, I do them with little thought. I even switch capslock on and off mid-password without thinking about it to type a capitalised portion.
Yes really. Anyone can hit ok, but not anyone knows the admin password. Someone can't walk up to your machine while you're away and install software in Linux, they can in windows. Hitting Ok is not sufficient. The point of sudo is to verify your identity, an ok prompt does not do that.
No, it's not administrator by default. The first user created is an administrator, but that user normally runs in a standard user security context. The prompt provides a temporary elevation to administrator level by use of an administrative security token associated with the account. The prompt also runs in a separate desktop to prevent malicious code from interfering with it.
If you try creating a new user through the control panel, you'll notice that the default selection is to create a standard user.
As for your last point, you're complaining about nano. It would be perfectly possible for an editor to sudo when writing to disk.