Solved

Neet to su without entering root password

Posted on 2006-11-02
11
348 Views
Last Modified: 2011-10-03
Hello,

is there any way for a non-root user to su to root without entering a password?

I looked for a -p option on su but to no avail.

I need for a script to run a program as root and then get back out

i was hoping for something like this:

su -p password -c command

so far I only see the ability to su and manually type the password.
0
Comment
Question by:jameswalt
11 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 17859386
0
 
LVL 9

Expert Comment

by:bigjimbo813
ID: 17859395
you can specify certain programs to allow all users to run it as root....is this what your asking?
0
 
LVL 9

Expert Comment

by:bigjimbo813
ID: 17859403
sudo will still require you to enter a password though.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 34

Accepted Solution

by:
PsiCop earned 50 total points
ID: 17859725
Actually, bigjimbo813, that is configurable. You can tell sudo to *not* require a password for specific commands or specific users. Try using it some time.
0
 
LVL 6

Expert Comment

by:_iskywalker_
ID: 17860754
sudo does not require password with you put the users in the sudoers group.
another way to make a user execute a program with root priviledges is putting the s bit, like bigjimbo812 said:
make root own that file, then chmod 755 file then chmod +s file. man chmod, for questions
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 17861870
SUID programs are a Very Bad Idea (tm) in the modern security environment. If there are any holes in the SUID'd program, they become exploitable with root privilege.

sudo is the tool you want to use. It provides *controlled* privilege escalation that can be logged and audited.
0
 
LVL 1

Expert Comment

by:tissier
ID: 17864909
Sudo is a good solution.

I depends on what you want to do under root privileges. Maybe you can simply add user in the good groups ?
0
 
LVL 9

Expert Comment

by:bigjimbo813
ID: 17883985
i agree sudo would be the best option....I just was not aware you could configure it to not require a password. Thanks for the tip Psi
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

#Citrix #POC #XenDesktop #vCenter #VMware #ESX
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now