The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
Google UNIX.COM


UNIX Desktop for Dummies Questions & Answers Questions regarding GNOME, KDE, CDE, Open Office, etc go here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to create an user aemunathan SUN Solaris 5 05-28-2008 12:59 PM
How to create a user in HP-UX Harikrishna HP-UX 3 02-08-2008 07:31 AM
create user magasem HP-UX 2 10-09-2006 05:50 PM
I create user but i cant login the user i created. jerome UNIX for Dummies Questions & Answers 5 06-09-2006 02:08 PM
Other than root user .Normal user is unable to create files mallesh UNIX for Advanced & Expert Users 1 06-22-2005 09:18 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-10-2005
Registered User
 

Join Date: Feb 2005
Posts: 5
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
Reply With Quote
Forum Sponsor
  #2  
Old 06-10-2005
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
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.
__________________
My brain is your brain
Reply With Quote
  #3  
Old 06-10-2005
Registered User
 

Join Date: Feb 2005
Posts: 5
Red face

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
Reply With Quote
  #4  
Old 06-13-2005
Registered User
 

Join Date: Feb 2005
Posts: 5
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
Reply With Quote
  #5  
Old 06-13-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
Try setting the user's shell to /bin/nologin. That should help.
Reply With Quote
  #6  
Old 06-13-2005
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0