LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-16-2018, 04:13 PM   #1
volcblack
Member
 
Registered: Apr 2018
Posts: 36

Rep: Reputation: Disabled
su - without password


Hello community,

Is there a way to perform su - userb without asking for password.

I tried
1 -in visudo userb ALL=(ALL) NOPASSWD(ALL)
This outcome allows me to run sudo without asking for password but still ask for su -
2- added the same user at the bottom (same outcome)
3- change the user to wheel but still ask for su -
And change the original user group

Anyone have a solution for this ?
Thanks
 
Old 06-16-2018, 04:28 PM   #2
volcblack
Member
 
Registered: Apr 2018
Posts: 36

Original Poster
Rep: Reputation: Disabled
su - without password

forgot to mention centOS 7
 
Old 06-16-2018, 04:56 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
you could do an alias in .bashrc leaving your sudoers file with no passwd for wheel, or sudo group.
Code:
alias su='sudo su -'

$ su

Smile, Cthulu Loathes You.

root@slacurr:~# pwd
/root
 
Old 06-16-2018, 05:06 PM   #4
volcblack
Member
 
Registered: Apr 2018
Posts: 36

Original Poster
Rep: Reputation: Disabled
su - without password

sudo su -

Thanks that helps
 
Old 06-17-2018, 11:47 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Can I ask why you'd want to do that ?
 
Old 06-18-2018, 01:47 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
see man su, su cannot be used without password.
using su and sudo together is deprecated.
I think what you really need is sudo, not su.
And as it was asked in post #5 why do you need it at all?
 
Old 06-18-2018, 07:24 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
laziness No. 1 leading cause for all short cutting, or time management 2nd leading cause.
 
Old 06-18-2018, 01:20 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by BW-userx View Post
laziness or time management
aren't those synonyms?
 
Old 06-18-2018, 03:13 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by ondoho View Post
aren't those synonyms?
depends on who you're talking to, your boss or a fellow worker.
 
  


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
Unable to find Administrators password does not recognize my login password the only password I entered at setup of Linux scholarsgold Linux - Newbie 6 01-23-2018 03:58 PM
Ubuntu 11.04 encrypted LVM password not working after user login password change prateekm21 Linux - Security 0 10-29-2011 01:20 PM
[SOLVED] Installed newest Ubuntu setting a weak password. Changed password now buggered? lugoteehalt Ubuntu 1 05-29-2010 09:51 PM
simpler GUI password for Administrative tasks while retaining complex user password? workforfood Ubuntu 1 08-29-2009 06:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:42 PM.

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