How is that in any way better than "sudo -i" (which I already suggested, and which avoids a needless extra command invocation)?

Gilbert

On 2021-04-07 9:28 a.m., Teh, Kenneth M. wrote:
If you need to run a lot of commands as root, the easiest sudo method is simply 'sudo su -' which makes you into root.  The trailing '-' does a login which replaces your environment with root's.

------------------------------------------------------------------------
*From:* owner-scientific-linux-us...@listserv.fnal.gov <owner-scientific-linux-us...@listserv.fnal.gov> on behalf of Gilbert E. Detillieux <gede...@cs.umanitoba.ca>
*Sent:* Wednesday, April 7, 2021 9:19 AM
*To:* Andrew C Aitchison <and...@aitchison.me.uk>
*Cc:* scientific-linux-users <SCIENTIFIC-LINUX-USERS@FNAL.GOV>
*Subject:* Re: sudo - was Re: FWIW: AlmaLinux now available.
On 2021-04-07 2:11 a.m., Andrew C Aitchison wrote:
On Tue, 6 Apr 2021, Yasha Karant wrote:

 The major issue I find is that everything at the system level is sudo -- however, for Ubuntu, I have found the fixes so that I can become root and do what I need both from a text interface and a GUI interface.

I find sudo on Ubuntu much easier to use than sudo on SL6.
By default on Ubuntu you can run succeccive sudo commands without
reentering the password each time.
I never figured out how to do that with SL.

That doesn't sound like default behaviour for sudo on SL6.  I've been
using it for years, and haven't had the password issue you mention.

Since sudo is pretty old, stable code, there likely aren't any
differences between its implementation in RHEL/SL vs Debian/Ubuntu,
other than the content of the /etc/sudoers file.  I'd check that against
the distro's clean, initial configuration, and see what's broken.

When I need to use pipes or redirect stdin and stdout as root,
a simple "sudo bash" first solves those issues.

You can use "sudo -i" to accomplish the same thing, but with perhaps
more "sane" initial setup, since it simulates a login.

Gilbert

Reply via email to