Sponsored Content
Full Discussion: Change user
Top Forums Shell Programming and Scripting Change user Post 303037579 by rdrtx1 on Tuesday 6th of August 2019 07:13:05 PM
Old 08-06-2019
su should not allow a regular user to start a shell or process for another user without a password. Only root user can do that.
 

8 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

User name change?

Hello, I love the service. My username is Jmt. Can I change that to WebKruncher? Thanks, -Jmt WebKruncher.com - sole proprietor. (1 Reply)
Discussion started by: Jmt
1 Replies

2. Forum Support Area for Unregistered Users & Account Problems

Change of user name

I am on several other Forums under the handle of FloridaBD and therefore would like to request that my user name here on Unix forums be changed from SunBurntYux to FloridaBSD Thanks. (1 Reply)
Discussion started by: SunBurntYux
1 Replies

3. Shell Programming and Scripting

How do i change to super user then revert back to ordinary user ,using shell script?

Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive... However if i try pfexec eject it... (3 Replies)
Discussion started by: wrapster
3 Replies

4. UNIX for Dummies Questions & Answers

change user> to user@host> ssh prompt

Hi, I was wondering how to change the prompt for my ssh login. At the moment it is like user> while I'd like it to be as user@host> It is in the .bash_profile or .ssh ??? Thanks (2 Replies)
Discussion started by: pmasterkim
2 Replies

5. Shell Programming and Scripting

Change user

Hi, I have to change many times user in a script. With the command su userName I receive the request for password. I need to open a session with another user I would put the password at the beginning. How can I do it? Thanks, bye bye. ---------- Post updated 22-04-10 at 10:58 AM ----------... (9 Replies)
Discussion started by: abdujaparov
9 Replies

6. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

7. Red Hat

Change user from SH TO CSH

Dear Experts, I'm currently working on a Red Hat Linux env. I have been working in AIX. My user is set to use SH default so when it logs in, we have to manually csh to do few things. I know you can change this in AIX using smitty tool. is there any similar too in LINUX that can change it? ... (7 Replies)
Discussion started by: Afi_Linux
7 Replies

8. AIX

How to change normal user id to LDAP user id?

If I create a new user id test: mkuser id=400 test then I want it to LDAP user: chuser -R LDAP SYSTEM=LDAP registry=LDAP test It shows: 3004-687 User "test" does not exist. How to do? (4 Replies)
Discussion started by: rainbow_bean
4 Replies
su(1)							      General Commands Manual							     su(1)

NAME
su - Substitutes user ID temporarily SYNOPSIS
su [- | -f] [user] [shell_option] [shell_command] OPTIONS
Prevents the user's shell initialization file from being executed by passing the -f option to the user's shell, thus making su start up faster. The -f option is supported by the csh family of shells. Simulates a full login by executing the commands in either the and files for csh or the file for sh and ksh and by setting the current working directory to the user's home directory. Passes the specified shell option flag to the newly invoked user's shell for execution. The shell_option must be supported by the invoked shell. The csh, sh, ksh, and any other interactive command shell support the commonly used -c shell option. By default (no "shell_option"), the shell is opened with the -i (interactive) shell option. See the reference page for the shell you are using for more information on the shell options. Passes the specified command to the newly invoked user's shell for execution. The shell_command must be supported by the invoked shell. DESCRIPTION
The su command demands the password of the specified user, and if it is given, changes to that user and invokes the user's shell without changing the current directory. Except in a case where the - option is used, the user environment is unchanged except for HOME, SHELL, USER, and LOGNAME which are taken from the password file for the user being substituted (see environ). The new user ID stays in force until the shell exits. If no user is specified, root is assumed. Only users who belong to group number 0 (system) can issue su to become root, even with the root password. To remind superusers of their responsibilities, the shell substitutes a # (number sign) for its usual prompt. Shell commands may be passed to the shell that is spawned by su by including them on the command line after the su flags and arguments. After the flags recognized by su and the user argument are processed, unrecognized command line flags (shell_options) and/or arguments (shell_commands) are passed to the shell for execution. If the spawned shell does not support the command or the format of the command, the command is not executed and the resulting shell behavior and error messages are determined by the shell. Security Restrictions The su command fails if any lock conditions exist on the target account. Specifically, if the destination account was retired, if the num- ber of unsuccessful login attempts exceeds the maximum allowed, if the administrative lock was applied, or the password's lifetime was exceeded, the Information System Security Officer (ISSO) must unlock the destination account before any user can log in to it or use su to transition to it. SECURITY NOTE
This security-sensitive command uses SIA (Security Integration Architecture) as an interface to the security mechanism(s) that perform the actual user validation. See the matrix.conf(4) reference page for more information. ENVIRONMENT VARIABLES
The following environment variables affect the behavior of su: SEE ALSO
Commands: csh(1), ksh(1), sh(1) su(1)
All times are GMT -4. The time now is 06:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy