Need to create a user...


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers Need to create a user...
# 1  
Old 06-10-2005
Question Need to create a user...

who you can't log in as, but you can su over to them once you get on.

I am aware of how to make a no login user by using /NOSHELL in the spot for the shell in the passwd file, but my question is if I do that and then get on the box as a user who I can log in as and "su -" over to the nologin user when I hit his environment and it reads the variables to set it up will it see that and not let me log in as them or will it work out OK?

I realize if I "su" to them I just get theri permissions, but if I need to also use their environment (ie "su -") then what do I do?

Any help is appreciated, Thanks in advance,
New_Guru
# 2  
Old 06-10-2005
You shouldnt have any problems su'ing over to a nologin user. its up to you whether you want to carry over your profile depending on how you su with or without the "-".

It is fairly straightforward. there shouldnt be any issues.
# 3  
Old 06-10-2005
Power

I thought that may be the case. In my particular situation I am taking a user that already exists and removing the ability to log in as that user. I just wanted to be sure before I did it because the user whos login ability is going away is the owner of a lot of files and software on my system. If I do this and it causes the system to not be able to run things I would be in trouble.
Thanks for the info,
New_Guru Smilie
# 4  
Old 06-13-2005
Question

I used the "/NOSHELL" value in the passwd file where the shell variable is supposed to be. When I try to "su" or "su -" over to that user and it says, "su: No shell" and will not let me.

So I will state my question again unless I was not clear before. I need to change an existing user lets call him user #1 (who owns a lot of software and scripts I can not break the usability of) from a user you log onto the system as to a user you cannot log on as anymore. I want to be able to log on as a different user (lets say user #2) and then "su" or "su -" over to the user #1 who I can no longer log on as.

Thanks again in advance,
New_Guru
# 5  
Old 06-13-2005
Try setting the user's shell to /bin/nologin. That should help.
# 6  
Old 06-14-2005
why not give the "nologin" user ksh as the login shell and put code in $HOME/.profile to check for whether $LOGNAME correspond to the "who am i" output? if yes, exit out ... if no, proceed ... (change $LOGNAME and "who am i" as appropriate for your OS) ...
Code:
ME=$(who am i | awk '{print $1}')
if [ "$LOGNAME" = "$ME" ]
then
    echo "Login not allowed"
    exit
fi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find if a User exist if not create user

What I'm trying to do is write a script in Perl to find a user and if that user exist it would print "User Exist, Pls Try Again". If The user doesn't exist I'm able to create a user with a password. Any suggestions? (3 Replies)
Discussion started by: GoBoyGo
3 Replies

2. Emergency UNIX and Linux Support

How to create user?

Hi, Quick question. How to create user in Unix after they login at the first time then they need to change password. Thanks in Advance :):) (5 Replies)
Discussion started by: justbow
5 Replies

3. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

4. Ubuntu

Create New User with the same group nd privileges of the other user

Hi, Anyone can help me on how to duplicate privileges and group for useroradb01 to userrootdb01. I have currently using "useroradb01" and create a newly user "userrootdb01". I want both in the sames privileges and group. Please see the existing users list below; drwxr-xr-x 53 useroradb01... (0 Replies)
Discussion started by: fspalero
0 Replies

5. Solaris

how to create an user

hi can anyone help me out to create an user to access specific folder only. (5 Replies)
Discussion started by: aemunathan
5 Replies

6. HP-UX

How to create a user in HP-UX

HI Guys, Can you help me creating a user account in a HP-UX server (3 Replies)
Discussion started by: Harikrishna
3 Replies

7. UNIX for Dummies Questions & Answers

create New UNIX User

Hi all, I wish to create some users, I can do that using the following command. useradd I wonder If i could create Uers as a clone of Root. I mean different users but having the same provileages as Root user. Can be ablle to access the Root Dir and so on .. Please help me out Is this... (6 Replies)
Discussion started by: Asteroid
6 Replies

8. HP-UX

create user

I need to create new user from the root.which command can i used ? (2 Replies)
Discussion started by: magasem
2 Replies

9. UNIX for Dummies Questions & Answers

I create user but i cant login the user i created.

I created a user, i login as a root. I add him in the group where he can access and login as a root! I checked it in users' list and in group's list, he is there. My problem is this, I cant login using the username/account I just created! What should i do to use and login the user/account i've just... (5 Replies)
Discussion started by: jerome
5 Replies

10. UNIX for Advanced & Expert Users

Other than root user .Normal user is unable to create files

Hi all, I am using Sun Solaris 9 .In this system normal users unable to create files from the command line.I added these users in bin,adm and even root group i found them unable to create a file. (1 Reply)
Discussion started by: mallesh
1 Replies
Login or Register to Ask a Question