Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

login(3) [netbsd man page]

LOGIN(3)						   BSD Library Functions Manual 						  LOGIN(3)

NAME
login, logout, logwtmp -- login utility functions LIBRARY
System Utilities Library (libutil, -lutil) SYNOPSIS
#include <util.h> void login(struct utmp *ut); int logout(const char *line); void logwtmp(const char *line, const char *name, const char *host); DESCRIPTION
The login(), logout(), and logwtmp() functions operate on the database of current users in /var/run/utmp and on the logfile /var/log/wtmp of logins and logouts. The login() function updates the /var/run/utmp and /var/log/wtmp files with user information contained in ut. The logout() function removes the entry from /var/run/utmp corresponding to the device line. The logwtmp() function adds an entry to /var/log/wtmp. Since login() will add the appropriate entry for /var/log/wtmp during a login, logwtmp() is usually used for logouts. RETURN VALUES
logout() returns non-zero if it was able to find and delete an entry for line, and zero if there is no entry for line in /var/run/utmp. FILES
/dev/* /etc/ttys /var/run/utmp /var/log/wtmp SEE ALSO
utmp(5) BSD
December 14, 1995 BSD

Check Out this Related Man Page

LOGIN(3)						   BSD Library Functions Manual 						  LOGIN(3)

NAME
login, logout, logwtmp -- login utility functions (DEPRECATED) SYNOPSIS
#include <util.h> void login(struct utmp *ut); int logout(const char *line); void logwtmp(const char *line, const char *name, const char *host); DESCRIPTION
The login(), logout(), and logwtmp() functions are DEPRECATED; use pututxline(3) instead. These functions operate on the database of current users in /var/run/utmpx and the system log file. Superuser permission is required. The login() function updates the /var/run/utmpx files with user information contained in ut (after converting to a struct utmpx, as described in pututxline(3)). The logout() function removes the entry from /var/run/utmpx corresponding to the device line. The logwtmp() function adds an entry to the system log file. Since login() will add the appropriate entry during a login, logwtmp() is usu- ally used for logouts. RETURN VALUES
logout() returns non-zero if it was able to find and delete an entry for line, and zero if there is no entry for line in /var/run/utmpx. However, there is no error indication due to lack of permissions. FILES
/dev/* /var/run/utmpx SEE ALSO
pututxline(3), utmp(5), utmpx(5) BSD
December 14, 1995 BSD
Man Page

13 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

changing the telnet banner

I don't want SunOS 5.8 to appear when someone logs into my machine... how do I go about changing the banner? I was thumbing through my unix books and I haven't found anything... I'm probably looking under the wrong topic... anyways... any help would be greatly appreciated. (20 Replies)
Discussion started by: xyyz
20 Replies

2. UNIX for Dummies Questions & Answers

unix login welcome message

When I telnet to a unix server someone put a stupid message there: Last login: Mon Nov 15 16:59:13 from xxx.xxx.xxx.xxx Sun Microsystems Inc. SunOS 5.8 Generic Patch October 2001 YO! <-- message Mon Nov 15 17:19:05 EST 2004 How did they do it and how can I find out who did it? ... (17 Replies)
Discussion started by: webtekie
17 Replies

3. Solaris

Solaris 8 login GUI doesn't come up.

Hi experts, I've installed Solaris 8 to Sunfire V480. After installation I only could login to the server using CLI command. Can you show me how to start the login GUI? I use standard SUN graphic monitor and keyboard. Thanks in advanced. VN (26 Replies)
Discussion started by: vntiger
26 Replies

4. Solaris

Solaris 9 login Screen not loading

The system loads fine no errors on the system during boot. when it tries to start it goes to hostname % it does not show the login screen for the users. any help on this would be great. is the X11 not starting properly? (16 Replies)
Discussion started by: deaconf19
16 Replies

5. UNIX for Dummies Questions & Answers

New Approach Hiding login password from ps -ef

Hello all , I looked up this site for solutions to hide login info from ps -ef | grep like using a seperate file and store the password in that especially for oracle sqlplus scripts. I just got this thought , But dont know how to implement this in UNIX. Is there a way to revoke access from... (17 Replies)
Discussion started by: simonsimon
17 Replies

6. Shell Programming and Scripting

SSH shell script does not work

Hello I have a Zabbix Server were Linux kernel version 2.6.26-2-amd64 is running. now my Question how can i make a script that does: - connect with ssh to a device - get the systeminfo (but only the interfaces, mac adresses, serialnumber and Software version) - write the output in a file ... (18 Replies)
Discussion started by: Fraggy
18 Replies

7. Emergency UNIX and Linux Support

Limiting a user to a script upon login, nothing else.

Hi there, I have a Debian 5.0 server that my company uses for deployment testing. This server needs to be accessed by NOC people that have no NIX knowledge whatsoever. I am creating a bash script for a menu-based command interface for the commands they need to run on their testing routines,... (21 Replies)
Discussion started by: ppucci
21 Replies

8. AIX

Last login details in banner

Friends!! I need your help. Where can i change/set the last login details as below in aix 5.3. And how to do that to get the results as exactly below login as: mbpops mbpops@xx.28.3.24's password: Last unsuccessful login: Mon Nov 22 14:32:27 GMT 2010 on ssh from 10.132.5.129 Last login:... (17 Replies)
Discussion started by: kmvinay
17 Replies

9. HP-UX

Enable telnet as root to 11.31 non-trusted system?

I have a new box that was set up for me and I want to allow telnet to the box as root. I know that it's not secure but due to the nature of what I test I need an easy and reliable way back in if I've messed up the other connection methods(SSH). This is in a protected lab environment. Eventually... (17 Replies)
Discussion started by: gctaylor
17 Replies

10. Shell Programming and Scripting

login audit bash script

I am a bash beginner and I need to write an script to check my users login time. This has to be in a format of : This script has to work on a server to check all the users. I know that I have to use "last" command but I have no idea how to do it. any assistance is appreciated. Thanks (17 Replies)
Discussion started by: bashily
17 Replies

11. Shell Programming and Scripting

FTP Login Error check

How can I add a check right after the FTP to see if the login id failed or not and echo an error description indicating login failed? Here is my script: ftp $HOST1 <<END_SCRIPT>>$TARGETLOGS/$LOGFILE #ftp $HOST1 <<END_SCRIPT> cd idx prompt mget $PICKUPFILE*.txt !cp $PICKUPFILE*... (17 Replies)
Discussion started by: mrn6430
17 Replies

12. 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

13. Shell Programming and Scripting

How to enforce user to Enter text when login to a UNIX / Linux system?

Hi. I inject my tracklogin.sh script in the profile of each user. $ more .profile ./tracklogin.sh # This is the default standard profile provided to a user. MAIL=/usr/mail/${LOGNAME:?} bash-3.2$ more tracklogin.sh #!/bin/bash tdate=$(date +"%d%m%y") mkdir -p /tmp/root_log... (20 Replies)
Discussion started by: mohtashims
20 Replies