Is there a way to have a one-time sudo account?
My use-case is the following.
I have an Ubuntu station with no remote ssh allowed to that machine. The machine generally serves as a public-use computer. But sometimes I would like to grant root access to some people (who I know personally) based on e.g. SMS or IM communication. Of course I don't mean giving them full root access, just one restricted to some commands like
apt-get or so. In no way do I intend to allow them to write to
But obviously I don't want to share the root password. And I also don't want those people to have root access forever, nor do I want to delete accounts or change passwords manually.
So I thought about creating a (sufficiently large) amount of root-access accounts and save their passwords to my laptop or phone. In the case I needed to provide root access to someone, I'd just send him the login information for an account that would be deleted when the sudo password-cache timout ends up.
Do you think this is a good approach? And if it is, where and how to setup the deletion script?