1833784 Members
2398 Online
110063 Solutions
New Discussion

su -i illegal option

 
TMcB
Super Advisor

su -i illegal option

On our HPUX 11 server, I cannot do a 'su -i'
I get the following message :
su: illegal option -- i
su: Unknown id: -i

It works OK using 'su' on its own.

Has anyone seen this before?
Thanks
2 REPLIES 2
Michael Tully
Honored Contributor

Re: su -i illegal option

su -i is an illegal option as the 'su' command does not use this selection. You can use 'su - otheruser -c' which runs a command as a different user for example. The second message relating to unknown id means that it cannot find a user called 'i' either. Yes 'su' own it's own will work fine.

best options:

Asks for a password for using 'root'
$ su -

$ su - otheruser (switches to another user)

$ su -c otheruser (runs a command as another user)
This one is generally done from within a script.
Anyone for a Mutiny ?
Massimo Bianchi
Honored Contributor

Re: su -i illegal option

from "man su"

NAME
su - switch user

SYNOPSIS
su [-] [username [arguments]]


put a space between - and i

Massimo