How to switch user in shell scripting (without root)?
Hi everyone:
I need create a script that must switch user and then must execute
certain commands, sadly neither my user nor the second user have no privileges
for su - ,
I've tried everything but seems su doesn't accept input redirection,
Is is possible switch user from a non-root user to root user without entering the password interactively inside a korn shell script which is run by a non-root user?
e.g. I have a non-root user called infodba who is in dba group and I want to create a shell script which is executed by infodba... (5 Replies)
Hi everyone:
I have a big trouble, I need create a script that must switch user and then must execute
certain commands, sadly neither my user nor the second user have no privileges
for sudo, I've tried everything but seems su doesn't accept input redirection, please help me, it's very... (8 Replies)
Hi Experts,
I'm trying to write a shell script to stop few things where i have to use another user to execute a command. Otherwise it will not work.
Your help is really appreciated
Thanks, (16 Replies)
Hi Gurus,
I have a script that requires me to switch from local user to root. Anyone who has an idea on this since when i switch user to root it requires me to input root password.
It seems that i need to use expect module here, but i don't know how to create the object for this.
... (1 Reply)
Hi,
I am new to Solaris and when i am trying to Switch to root login from user, system throws message saying permissions denied...
Steps I Followed:
Created a user and logged into that user by SU username
tried to come back to root but system throws message "permissions denied"
... (7 Replies)
Hi,
I have written a script for finding deviation for router,switch &fw.
It is working fine on linux server.
But when I try on sunos 5.10 OS it showing "grep: illegal option -- A". I have used grep -C and grep -A.
How it will work on sunos?
Help me out please !! (12 Replies)
Hi all,
I have a small problem. When I log in as root and try to switch to any other user using su -user, then it is giving an error saying libncurses.so permission denied. Can you help me?
Thank you in advance.
Sai. (1 Reply)
I am writing a korn shell script where i need to switch to root in between and again exit from root to normal user and continue other commands.
Is that possible to switch between these two in the same script? (1 Reply)
Hi,
I need to switch from local user to root user in a shell script.
I need to make it automated so that it doesn't prompt for the root password.
I heard the su command will do that work but it prompt for the password.
and also can someone tell me whether su command spawns a new shell or... (1 Reply)
HI
in a server we can't login with root user directly but i can login with different user and then i can switch to root user by su command
Requirement
is there anyway where i can write a script without mentioning password in file as mentioning the root password is not the... (3 Replies)
Discussion started by: scriptor
3 Replies
LEARN ABOUT HPUX
opx25
opx25(1M)opx25(1M)NAME
opx25 - execute HALGOL programs
SYNOPSIS
scriptname] char] file-descriptor] file-descriptor] string]
DESCRIPTION
The commands, including are targeted for removal from HP-UX; see the below.
HALGOL is a simple language for communicating with devices such as modems and X.25 PADs. It has simple statements similar to and that are
described below.
Options
recognizes the following options:
Causes to read script as the input program. If is not specified, reads the standard input as a script.
Causes to use char as the first character in the input stream instead of actually reading it from the input descriptor.
This is useful sometimes when the program that calls is forced to read a character but then cannot ``unread'' it.
Causes to use number for the output file descriptor (i.e., the device to use for The default is 1.
Causes to use 'number' for the input file descriptor (ie, the device to use for 'expect'). The default is 0.
Causes to save this string for use when is encountered in a command.
Causes to turn on debugging mode.
Causes to turn on verbose mode.
An script file contains lines of the following types:
(empty) Empty lines are ignored.
Lines beginning with a slash
are ignored (comments)
ID ID denotes a label, and is limited to alphanumerics or
string must be surrounded by double quotes. The text is sent to the device specified by the option. Non-printable charac-
ters are represented as in C; i.e., as DDD, where DDD is the octal ascii character code. in a send string is the
string that followed the option.
Send a break "character" to the device.
Here number is how many seconds to wait before giving up. 0 means wait forever, but this is not advised. Whenever string
appears in the input within the time allotted, the command succeeds. Thus, it is not necessary to specify the entire
string. For example, if you know that the PAD will send several lines followed by an prompt, you could just use as
the string.
The program etc.) is run with the args specified. Do not use quotes here. Also, the program is invoked directly (using so wild
cards, redirection, etc. are not possible.
If the most recent expect or run encountered an error,
go to the label ID.
Similar to but does not fork.
Similar to but goes to standard error instead of to the device.
Sets the program in debug mode.
It echoes each line to as well as giving the result of each expect and run. This can be useful for writing new
scripts. The command disables this feature.
Sends subsequent incoming characters to
This can be used in the file as a security measure, because part of the incoming data stream contains the number of
the caller. There is a similar feature in it writes the time and the login name into the same logfile. The command
disables this feature.
Similar to but better in some cases because it sends only digits to the log file, and not other characters. The command dis-
ables this feature.
Sets a global timeout value.
Each expect uses time in the timeout reservoir; when this time is gone, the program gives up (exit 1). If this com-
mand is not used, there is no global timeout. Also, the global timeout can be reset any time, and a value of 0 turns
it off.
Exits with this value.
0 is success; anything else is failure.
To perform a rudimentary test of configuration files, run by hand, using the option followed by the name of the script file. then sends to
standard output and expects from standard input; thus you can type the input, observe the output, and use the command to see messages. See
the file for a good example of HALGOL programming.
WARNINGS
Use of commands, including is discouraged because they are targeted for removal from HP-UX. Use ftp(1) or rcp(1) instead.
AUTHOR
was developed by HP.
SEE ALSO getx25(1), uucp(1).
TO BE OBSOLETED opx25(1M)