LinuxQuestions.org
Review your favorite Linux distribution.
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 01-26-2012, 01:31 PM   #1
nerak99
Member
 
Registered: Feb 2006
Distribution: FC 15
Posts: 42

Rep: Reputation: 2
root pw


Macs and Ubuntu (I think) do not allow you to su -, you have to use sudo. Apparently this is a good thing.
You can use sudo passwd root to set a root pw and that allows you to do su -

My questions are:

How do you remove the ability to su - so you go back to having to do sudo all the time?

Why is it viewed as a "bad thing" to have su - enabled?
 
Old 01-26-2012, 01:40 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,681
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
su is a binary (e.g. a file in /bin/su on some systems). You could move this binary to something like /bin/secret_su or a cryptic name then create a wrapper script named su in its place. In the wrapper script you check to see see if the su command was called by sudo and if so you have it execute secret_su - if not you issue a message and exit something like:
Error: You must use 'sudo su' rather than just 'su'.

The reason why use of sudo is considered (by some) to be better is that sudo logs everything it does so theoretically you can see who did what on a system. If this is important to you then you should insure you're sending logging to another server to prevent someone who became root from simply deleting the logs to hide their tracks. In many distros "sudo su" is NOT required.

Last edited by MensaWater; 01-26-2012 at 01:42 PM.
 
1 members found this post helpful.
Old 01-26-2012, 01:53 PM   #3
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 4,136

Rep: Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157Reputation: 1157
First of all, Ubuntu "allows" you to do anything you want. Some users prefer sudo and some users prefer su. Linux is all about choice and freedom.

Second if you have enabled the root account, but change your mind and want to lock it, so that sudo is the only method:

Code:
sudo passwd -dl root
For more info:
https://help.ubuntu.com/community/RootSudo
 
1 members found this post helpful.
Old 01-26-2012, 04:12 PM   #4
nerak99
Member
 
Registered: Feb 2006
Distribution: FC 15
Posts: 42

Original Poster
Rep: Reputation: 2
Thanks

Hey thanks. BTW It wasn't a sleight against ubuntu, it is just because the default setting on an ubuntu server I used was like a mac in having the su - disabled.
Thanks for the help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] how can i remount root filesystem as read/write after modify readonly-root file jcwkyl Linux - Newbie 3 12-21-2010 11:40 PM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 06:15 PM
why lftp command run failed when user isn't root, but ok when logining as root steven_yu Linux - Software 0 06-06-2007 09:36 PM
RHEL3 Mounting USB after reboot and between reboots: root and non-root users Luis Nunes Linux - Hardware 0 07-20-2005 09:32 AM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 05:14 PM


All times are GMT -5. The time now is 03:10 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration