LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 12-03-2016, 08:15 AM   #16
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled

Quote:
Originally Posted by MensaWater View Post
As the OP noted in first post this does not work in RHEL7 - That is why he was asking the question. I confirmed it on my RHEL7 systems after seeing his post because I hadn't tried it yet. It does work in RHEL5 & RHEL6.
Right, I forgot. But still, there should be a way to edit the keybindings in gnome (I'm KDE user, so no experiences in gnome). That is to say one should be able to retrofit the functionality to ALT + CTRL + <BACKSPACE>.

@Ratamahatta You can restrict sudo to single commands via the sudoers file, so it would not be indiscriminately showering root privileges all over the company .
 
Old 12-05-2016, 04:29 PM   #17
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by Ratamahatta View Post
Interesting. I thought that what sudo asks for (no password, user's password, root's password) depends entirely on the sudoers file. At least it's been that way on every desktop Linux system I have used.
And seriously, setting up the sudoers file so that all users can use root privileges is the worst possible idea for a company. We're not talking about a single-user-owned Laptop here.

When last I looked, the suid bit wasn't working with scripts. That's why writing a tiny C program that will hardcodedly execute some command is a better (as in portable, working, etc.) bet. You have to make sure to set the permissions right though, so users will not be able to change the command to be executed.
If you gave users the root password there would be no need for sudo in the first place as they'd be able to simply login as root and do anything they want. I'd be surprised if you'd run across a setup that relied on root's password for sudo but anything is possible.

It is barely possible you're confusing "su" (switch user) with "sudo" (super user do). If you do su by default it wants to switch to root and that DOES require the root password. (Similarly if you used su and specified a user it would switch to that user and prompt for that user's password.)

Using sudo by default asks for the invoking user's password. It CAN be configured to not require a password.

You seem to misunderstand the purpose of sudo. It is NOT the same as "su" which is switch user. Giving a user (or even a group of users) a grant to run a single command does NOT automatically give them a grant to run everything as root.

In fact you can setup multiple groups, hosts, commands and grants to do things differently based on which user is invoking the command and on which host they are doing the invocation. That is to say you don't have to give an entire group access to a command - you can give it to one person.

Sudo does NOT rely on the suid bit for the commands being invoked because sudo itself has the suid bit. The commands simply need to be executable by root.

I have seen bad setups where people do something silly like grant "sudo vi" without paying attention to the fact that vi has an escape to the shell. Since the "vi" session invoked by sudo would be running as root then the shell escaped to would be a root shell. However, these days sudo even has settings specifically to prevent such root escapes.

Also although sudo itself runs commands as root one doesn't have to setup programs that run as root. Here one of the uses we have for sudo is to allow certain users to become other administrative users e.g. We might allow all of our DBAs to switch to the "postgres" user to administer the Postgresql database. In such a case they type "sudo su - postgres". They then input their own passwords. They are then at the shell prompt for postgres user. Even though it was root that switched them from their own account to postgres account at no point are the DBAs actually the root user.

sudo has been around for many years and is a very good tool. Once you are used to its sudoers file setup really isn't that hard.
 
Old 12-06-2016, 07:52 AM   #18
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
For an easier start:

https://linux.die.net/man/5/sudoers (format error inside)
https://www.linuxquestions.org/quest...doers-5-37188/
https://www.michaelwlucas.com/tools/sudo

Swiped from
http://www.linuxquestions.org/questi...2/#post5619467

And also:
https://www.sudo.ws/man/1.8.15/sudo.man.html
https://www.sudo.ws/man/1.8.15/sudoers.man.html

Last edited by JZL240I-U; 12-06-2016 at 07:59 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rhel 5.5 hang logout salimshahzad Linux - Server 2 10-06-2010 07:43 AM
auto-logout in RHEL 3 pyroman59 Linux - Newbie 1 08-27-2009 01:18 PM
RHEL Workstation and AS | Registration the_gripmaster Red Hat 2 09-13-2006 08:25 AM
Remotely Force Logout of other Users? CoolAJ86 Linux - Security 5 04-16-2005 06:51 AM
Force logout bfloeagle Linux - General 4 01-07-2003 02:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration