Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Personalizing UNIX login script Post 302076619 by jim mcnamara on Wednesday 14th of June 2006 02:43:33 PM
Old 06-14-2006
You will have to grep for the username in /etc/passwd, then get the Person's name as it is entered in that file.

Code:
#!/bin/ksh
username=`logname`
fullname=$(grep "$username" /etc/passwd| awk '{print $5}' )
echo "Good day, $fullname"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

personalizing my unix environment

I share a login id/password with several folks so I don't like to change the .profile or other environment variables (e. g., set ignorecase in vi) that other users may expect to be set. Any suggestions to tailor my environment that will not affect other users (2 Replies)
Discussion started by: artjaniger
2 Replies

2. UNIX for Advanced & Expert Users

UNIX login ID

Hello World: I need to have a user ID called devapp in the passwd and shadow file for a certain application to start. The problem is that I do not want users to be able to use the devapp login ID to log directly into the system. The users sometimes need to start and stop the... (3 Replies)
Discussion started by: rambo15
3 Replies

3. Programming

Login script for unix ?

Anyone know of a script or program in a unix platform that will allow one login and password for three databases ? Say i have a social site that has a video site and phpBB3 forum but i want them connected as one login. I heard there is a script that does that , anyone know the name or where to get... (0 Replies)
Discussion started by: rumrunner439
0 Replies

4. Web Development

Login in Unix

Can anyone plz share the HTML code for login in UNIX. I am not able to verify the password. (2 Replies)
Discussion started by: manish.s
2 Replies

5. Shell Programming and Scripting

Shell script in tracking both the passed and failed login in a unix server

Can you help me in providing the following output or a quite similar to this from a shell script ? *** Logins Summary Information ***** ---------------------------------- Failed Login Attempts for Invalid Accounts Date Time IP-ADD Account ... (0 Replies)
Discussion started by: linuxgeek
0 Replies

6. Shell Programming and Scripting

UNIX Script to query Active Directory: give cn (NT login name) and receive mail (Email address)

Hi folks I need to write UNIX script (with ldapsearch) to query Active Directory. Input is NT login name and output is Email address. Attached a screenshot of Sysinternals "AD Explorer". I need to do the same in CLI. http://i.imgur.com/4s6FB.png I am absolute LDAP/ldapsearch noob. (0 Replies)
Discussion started by: slashdotweenie
0 Replies

7. Shell Programming and Scripting

Help with Unix bash shell script login

Hi, I am a complete Unix novice and need some help with creating a login shell script. I have created a file with user details i.e. PIN, name etc and require help in recalling the specified details from the file and being prompted for a password on login. Any help would be very much appreciated.... (0 Replies)
Discussion started by: tdsrogers
0 Replies

8. Shell Programming and Scripting

Issues for script that login to a unix box

Hi, I have a script that should login to a different box then the box that i am in and run the commands. I have the script sample below that logins to a unix box and get the files .Looks like ls-lrt command is not running or its wrongly used. #!/bin/bash # Ask the user for build month... (5 Replies)
Discussion started by: learninguser235
5 Replies

9. Shell Programming and Scripting

Script as login shell (passing args to login shell)

Hello all, for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell. So serverA launches the ssh command to serverB which has a local user with my script as a login shell. Local script works like a charm on his own. serverB$ grep... (20 Replies)
Discussion started by: maverick72
20 Replies

10. Programming

Remote login UNIX box from java passing parameters to the custom script called in the profile

Hello Good Day / Guten Tag.... I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard. So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() { public String... (1 Reply)
Discussion started by: Sanalkumaran
1 Replies
su(1)							      General Commands Manual							     su(1)

Name
       su - substitute a user ID

Syntax
       su [username]

       su - [username]

       su -f [username]

Description
       The  command  requests the password of the specified username.  If the correct password is given, changes to that username without changing
       the current directory.  The user environment is unchanged except for HOME and SHELL which are taken from the password file entry for  user-
       name.   The  shell  that  is  run  is also taken from the password file entry for username.  The new user ID stays in force until the shell
       exits.

       If no username is specified, `root' is assumed.	To remind the superuser of his responsibilities, the shell substitutes `#' for	its  usual
       prompt.

Options
       -f   Prevents from executing the .cshrc file, making start up faster.

       -    Simulates a full login.

Diagnostics
       Sorry
	    An invalid password was supplied for the specified username.

       Unknown login: username
	    The specified username was not found in the passwd database.

       No directory
	    The home directory for the username is not accessible at this time (only with ``-'' argument).

       No shell
	    The shell specified in the passwd database entry for username could not be executed.

       Kerberos initialization failure
	    Consult your system administrator.

       If enhanced security features are enabled the following error messages are also possible:

       Requires secure terminal
	    Attempt to su to UID 0 on a line that is not marked secure in

       User's password has expired
	    Access is denied because the password for username is expired.

       This account is disabled
	    Access is denied because the auth entry corresponding to username is marked disabled.

Files
       Log file of anyone who became
			root, with a date mark.

See Also
       csh(1), sh(1), passwd(5yp), environ(7), edauth(8)
       Security Guide for Administrators
       Security Guide for Users

																	     su(1)
All times are GMT -4. The time now is 09:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy