Sponsored Content
Top Forums Shell Programming and Scripting Executing Commands From Non-Standard Path (Changing user's PATH secretely???) Post 302348990 by reborg on Sunday 30th of August 2009 05:41:25 PM
Old 08-30-2009
Use a restricted shell such as rbash or rksh and set the path and don't allow users to execute commands not in their PATH
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Full path of executing script in ksh?

Hello all, Here's the scenario: I've got a script, let's call it script1. This script invokes another script, which we'll call set_env, via the dot "." command, like so: File: #!/bin/ksh # region_id=DEV . set_env ${region_id} and so on. Script set_env sets up an... (2 Replies)
Discussion started by: BriceBu
2 Replies

2. Shell Programming and Scripting

How to change prompt color when changing path

Hi all, Can you tell me how to change the prompt color (only the path part) when I chnange directory with "cd"? I use the sequence below in ".bashrc" (Solaris 8) to change my prompt colors and I'd like to modify it to change the path color when I cange directory. PSC() { echo -ne "\"; }... (0 Replies)
Discussion started by: majormark
0 Replies

3. Shell Programming and Scripting

Appending a path in user's PATH variable

Hello Folks, I want to append a path in user's PATH variable which should be available in current session. Background Numerous persons will run a utility. Aim is to add the absolute path of the utility the first time it runs so that next runs have the PATH in env & users can directly run... (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

4. Shell Programming and Scripting

Changing the path

Hi , Iam changing the path in weblogic from /opt/user/shared/mydomain to /opt/users/shared/multidomain i have to change the below configuration files by using scripting am using for loop and sed to change the below files. for i in ${b}startWebLogic.sh... (1 Reply)
Discussion started by: sam1226
1 Replies

5. Shell Programming and Scripting

Changing the Login Path

Hi frnds! i m installing a software named 'Gamit' by using bash. bt i recieved the follwoing error: .. removing any existing Makefiles or archive files from libraries directories /root/Documents/ISP/Gamit_10.4/com/rmfresh: Permission denied. .. removing any existing Makefiles or... (1 Reply)
Discussion started by: Engr. Shoaib
1 Replies

6. UNIX for Dummies Questions & Answers

Changing Path Variable

Blank Blank Blank (11 Replies)
Discussion started by: pvibien
11 Replies

7. UNIX for Dummies Questions & Answers

Changing path in many files

I have many html files in a directory tree and want to change the a path declaration within the files. Files will look as below I want to remove "geopdf/" so I get as example href=../../../geo1937/geo02n01/geo0201r00010016.pdf rather than keeping the entry as ... (1 Reply)
Discussion started by: kristinu
1 Replies

8. UNIX for Dummies Questions & Answers

Way to get Code/path , which is executing under a process?

Dear All, Please help me in finding solution for below problem. I need a command or script to get code or path(from which location code is being executed), which is executing under a process ID. I dont have google access here,Please help me in finding solution. Thank you. (3 Replies)
Discussion started by: subbarao12
3 Replies

9. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

10. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies
SU(1)							    BSD General Commands Manual 						     SU(1)

NAME
su -- substitute user identity SYNOPSIS
su [-] [-flm] [login [args]] DESCRIPTION
The su utility requests appropriate user credentials via PAM and switches to that user ID (the default user is the superuser). A shell is then executed. PAM is used to set the policy su(1) will use. In particular, by default only users in the ``admin'' or ``wheel'' groups can switch to UID 0 (``root''). This group requirement may be changed by modifying the ``pam_group'' section of /etc/pam.d/su. See pam_group(8) for details on how to modify this setting. By default, the environment is unmodified with the exception of USER, HOME, and SHELL. HOME and SHELL are set to the target login's default values. USER is set to the target login, unless the target login has a user ID of 0, in which case it is unmodified. The invoked shell is the one belonging to the target login. This is the traditional behavior of su. The options are as follows: -f If the invoked shell is csh(1), this option prevents it from reading the ``.cshrc'' file. -l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above. USER is set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is the target login's, and su will change directory to the target login's home directory. - (no letter) The same as -l. -m Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precau- tion, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su will fail. The -l (or -) and -m options are mutually exclusive; the last one specified overrides any previous ones. If the optional args are provided on the command line, they are passed to the login shell of the target login. Note that all command line arguments before the target login name are processed by su itself, everything after the target login name gets passed to the login shell. By default (unless the prompt is reset by a startup file) the super-user prompt is set to ``#'' to remind one of its awesome power. ENVIRONMENT
Environment variables used by su: HOME Default home directory of real user ID unless modified as specified above. PATH Default search path of real user ID unless modified as specified above. TERM Provides terminal type which may be retained for the substituted user ID. USER The user ID is always the effective ID (the target user ID) after an su unless the user ID is 0 (root). FILES
/etc/pam.d/su PAM configuration for su. EXAMPLES
su man -c catman Runs the command catman as user man. You will be asked for man's password unless your real UID is 0. su man -c 'catman /usr/share/man /usr/local/man' Same as above, but the target command consists of more than a single word and hence is quoted for use with the -c option being passed to the shell. (Most shells expect the argument to -c to be a single word). su -l foo Simulate a login for user foo. su - foo Same as above. su - Simulate a login for root. SEE ALSO
csh(1), sh(1), group(5), passwd(5), environ(7), pam_group(8) HISTORY
A su command appeared in Version 1 AT&T UNIX. BSD
September 13, 2006 BSD
All times are GMT -4. The time now is 12:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy