Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-14-2012
Registered User
 
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Bug su command clarification

Hi,

I want to use the "SU" command in script it is asking me to enter the password manually.

pleas the say the syntax of su command in single line that includes username/password.
Sponsored Links
    #2  
Old 06-14-2012
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Location: Switzerland - GE
Posts: 4,633
Thanks: 118
Thanked 256 Times in 245 Posts
So dont use su then...
There is the sudo utility you can use, if you dont have, get it installed by downloading the software from your favorite HP Archive center...

It can allow you to sudo a user without asking passwd once correctly configured...
Sponsored Links
    #3  
Old 06-14-2012
...@...
 
Join Date: Feb 2004
Location: NM
Posts: 9,652
Thanks: 164
Thanked 644 Times in 621 Posts
You have to use sudo. That requires setting up users in the sudoers file.


Code:
sudo su - someuser

You grant access on a per user basis or based on some other criteria.
    #4  
Old 06-14-2012
methyl methyl is offline Forum Staff  
Moderator
 
Join Date: Mar 2008
Posts: 6,388
Thanks: 286
Thanked 668 Times in 640 Posts
If you cannot install sudo, the target user can allow you access by making an entry in a .rhosts file containing a single line with two parameters:

Code:
hostname yourusername

See man .rhosts .
Make sure that any .rhosts file has permissions 600 and is owned by root (or less preferably owned by the user).

Some sites do not allow .rhosts files because they are deemed to be a security risk. This is mainly because it's easy to create one which would allow anybody access to an account.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Clarification on '1 days ago' in date command [Found answer, posted within] DeCoTwc UNIX for Dummies Questions & Answers 1 06-08-2010 12:10 PM
clarification Required in Write command little_wonder Shell Programming and Scripting 3 02-01-2010 09:04 PM
need clarification about tr -d command ? vparunkumar Shell Programming and Scripting 7 03-18-2008 11:08 AM
Sun Unix command clarification FredSmith Solaris 4 07-12-2007 01:30 AM
nawk command clarification Tux_Raju Shell Programming and Scripting 2 07-28-2005 09:28 AM



All times are GMT -4. The time now is 12:41 PM.