su - root , without pressing password

Thread Tools Search this Thread
Operating Systems Linux Red Hat su - root , without pressing password
# 1  
Old 08-09-2009
su - root , without pressing password

Dear Friends ,

I want to su the root user from a normal user without pressing any password , is it possible ?

Like ,
oracle# su - root
 passwd :

But here I want to directly enter as root user without pressing any password .

I need it , because , I need to run a script where the script is owned by the oracle and in the middle position of the script , I need to su the root user .

Waiting for kind reply ... ...

Last edited by rbatte1; 11-28-2016 at 11:29 AM..
# 2  
Old 08-09-2009

You can uncomment this line in /etc/pam.d/su:
auth            sufficient trust use_uid

And run the command
usermod -G oracle wheel

This would allow Oracle to su to root without the password. I hope your Sys Admin likes you!!
# 3  
Old 08-09-2009

what you want is not possible because it is built this way. If a non-root can become root without giving any password then what the point of passwords?

If oracle can become root then who wants to become oracle when you can be root instead? Then what security is there? ..... Hey who just killed the system do you know? ..... Because everybody on the system is now a superuser hacker? Smilie

I dunno whether it will work but if really still want you can try clear the encrypted root password in shadow file, and in password file root:X: change it to root::

But even if it works you will still have problems, because in the middle of your script where you run su - root you will enter a new shell and your script may do nothing.
# 4  
Old 08-09-2009
I don't think Oracle DBA's are hackers. Generally there should be a good relationship between them - especially in larger organisations.

Sun invented PAM(!), and this solution works, but I certainly wouldn't recommend it for anything other than installing Oracle.

Apart from running during an installation, I don't really know why the Oracle user would need root access. And takes about 0.0002 seconds to run, so it would be quicker for the admin to run it than doling out root access!

Last edited by Scott; 08-09-2009 at 03:40 PM..
# 5  
Old 08-09-2009
Woah ... smoke a peace pipe, take a deep breath and count to ten. Smilie

I never said Oracle DBA are hackers I was just trying to impress on this guy why su - root without passwords is a bad idea.

Last edited by rbatte1; 11-28-2016 at 11:30 AM..
# 6  
Old 08-09-2009
You may use sudo to accomplish what you need. Ensure you disable the "requiretty" if you need to run sudo in batch (i.e. from a script). Ensure you add the user via the visudoers command, ensure to select NOPASSWD, and specify the command to allow. Each time the authorized user invokes "sudo /some-command" it will be logged.
# 7  
Old 08-09-2009
Originally Posted by sparcguy
Woah ... smoke a peace pipe, take a deep breath and count to ten. Smilie

I never said Oracle DBA are hackers I was just trying to impress on this guy why su - root without passwords is a bad idea.
Sorry. For whatever reason that didn't quite come out as I intended Smilie

And you're right, it isn't a great idea.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Can a root role change the root password in Solaris 10?

i do not have root on a solairs 10 server , however i do have the root role, i was wondering if I can change the root password as a a role with the passwd command? I have not tried yet. and do i have to use the # chgkey -p afterwards? i need to patch is why i am asking. thanks (1 Reply)
Discussion started by: goya
1 Replies

2. Ubuntu

Root access that can't change root password?

We are having a little problem on a server. We want that some users should be able to do e.g. sudo and become root, but with the restriction that the user can't change root password. That is, a guarantee that we still can login to that server and become root no matter of what the other users will... (2 Replies)
Discussion started by: 244an
2 Replies

3. Solaris

Lost Root Password on VXVM Encapsulated Root Disk

Hi All Hope it's okay to post on this sub-forum, couldn't find a better place I've got a 480R running solaris 8 with veritas volume manager managing all filesystems, including an encapsulated root disk (I believe the root disk is encapsulated as one of the root mirror disks has an entry under... (1 Reply)
Discussion started by: sunnyd76
1 Replies

4. Solaris

Solaris 8 - Asks for current root password when trying to change root password.

Hello All, I have several solaris boxes running Solaris 8. When changing root passwords on them, all will simply ask for the new root password to change and of course to re-type the new password. One of the systems however asks for the existing root password before it will display the new password... (8 Replies)
Discussion started by: tferrazz
8 Replies

5. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

6. HP-UX

Root Password

Hi all, I am changing the root password periodically from eg: password01 to password02. However, I can still use password01 after it is changed, it seems that it only authenticates up the first few characters. Please can someone let me know how I can fix this. Thanks Ryan (1 Reply)
Discussion started by: macgre_r
1 Replies

7. UNIX for Dummies Questions & Answers

I need it to prompt me for a root password, so I don't have to log as root

Hi folks, I'm trying to install a program, and I want to place some of the executables into /usr/bin so that they can be executed from any folder on the computer. I've been giveng the root password, but told never to log in directly as root. Instead, I can wait for a password prompt. However, I... (2 Replies)
Discussion started by: lunchtime
2 Replies

8. Linux

how to access root priveliges if root password is lost

wish to know how to access root password it root password is forgotten in linux (1 Reply)
Discussion started by: wojtyla
1 Replies

9. Answers to Frequently Asked Questions

Lost root password / Can't login as root

We have quite a few threads about this subject. I have collected some of them and arranged them by the OS which is primarily discussed in the thread. That is because the exact procedure depends on the OS involved. What's more, since you often need to interact with the boot process, the... (0 Replies)
Discussion started by: Perderabo
0 Replies

10. UNIX for Dummies Questions & Answers

No root password

Hi guys n gals, I want to load a simulation software on the linux network. But my problem is I don't have root password. Any suggestions or clues?? Thanks (6 Replies)
Discussion started by: cyno
6 Replies
Login or Register to Ask a Question