Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

login(3) [osx 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

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

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to logout inactive users????

I would like to automatically logout from the system inactive users depending on their functions. For example there are users that I would like to logout after 15 minutes of inactivity, but there are others that I would like to logout after 30 minutes of inactivity. It's possible to do this??? (6 Replies)
Discussion started by: rrivas
6 Replies

2. UNIX for Dummies Questions & Answers

How can I make someone enter his ID in logout?

hi, Is there any way that I can ask ppl's ID when they wana log out in KDE? I wana know who's the last person who worked with the computer and I need his ID to find it out! (5 Replies)
Discussion started by: confusedoflife
5 Replies

3. UNIX for Dummies Questions & Answers

Sco unix

In sco unix sysyem, we can see the users by suing w. at the idel column we can know how long a user who login the system but do noting. My question is how can I auto logout such users like above? (6 Replies)
Discussion started by: luoxl
6 Replies

4. UNIX for Dummies Questions & Answers

logout command

hi all The "last" command shows the last login time of the user. is there any command for last logout time. as usual, replies are appreciated. thanks boys. raguram R (6 Replies)
Discussion started by: raguramtgr
6 Replies

5. Shell Programming and Scripting

placeing all work in a file form login

hai i want to place every work done by me in a file form login to logout. ex:- login : abc password: xxxx $pwd /home/abc $ls -l list of files in dir $logout now i want to place all commands given by me in a file for later reference. (5 Replies)
Discussion started by: g_s_r_c
5 Replies

6. Solaris

invalid login attempts...

I am wondering if solaris captures id's associated w/invalid login attempts? when I try to login as "test1" several (3-5) times, I do not find any userID info under "/var/adm" files: utmpx wtmpx messages lastlog Is there another location/log I should be checking? Is it necessary for... (6 Replies)
Discussion started by: mr_manny
6 Replies

7. Shell Programming and Scripting

detecting login or logout

what function would tell me that a user has logged in or out? i already know from my script the users name i already know in real time there was an event how an I tell if that event was a login or logout? Any ideas? # i did try comparing the file sizes for change but various users may... (8 Replies)
Discussion started by: nortypig
8 Replies

8. UNIX for Dummies Questions & Answers

free some space in file system

dear all, I have some problem in my file system : df -k result : ... /dev/md/dsk/d3 3101839 2736380 303423 91% /var ... it occupied around 2.7 gb but when I tried command du -sk /var 813991 /var so /var only have around 800Mb , Do you know why there is many difference... (6 Replies)
Discussion started by: fu4d
6 Replies

9. Solaris

Log Information about login/logout of any users

Hi to all, i want configure my solaris 10 machine to log all login,logout and "su" in a particularly file. How can i do it? Now i enable auth.* in syslog.conf but the informations are written in a confused mode... Thanks (4 Replies)
Discussion started by: suuuper
4 Replies

10. HP-UX

How to logout

Hi I am using UNIX version. HP-UX HP-UNIX B.11.00 I am writing a script which on certain condition should logout of unix. But with exit command i am not able to get this.. Plz suggest how i should logout of the session directly. (9 Replies)
Discussion started by: manish.s
9 Replies

11. UNIX for Dummies Questions & Answers

To merge a few lines to 1 line

Hi Experts, This is my input file. input.txt 0 /dev/fd 25 /var 1 /tmp 1 /var/run 1. If this file has single line, then leave it, print the single line else merge the 4 lines above into 1 line as below e.g (6 Replies)
Discussion started by: streddy
6 Replies

12. Solaris

Login and logout logs in server

Hi, Can you please let me know how can and where we will find the logs. ie,which user is login and logout from server and by using which ip address they accessed server. please let me know the steps and folder, file names to trace the logs from server . we are using System = SunOS 5.10. Please... (10 Replies)
Discussion started by: kancherla.sree
10 Replies

13. Programming

Passing Pointers by reference in C++ Problem

Hello All, I am having this issue...where I am actually having hard time understanding the problem: The code is as follows: #include<iostream.h> void fxn(char*** var) { int i =4; *var = (char**)malloc(i*sizeof(char*)); for(int j =0; j<4; j++) { *var = "name"; cout<<*var;... (6 Replies)
Discussion started by: mind@work
6 Replies

14. Solaris

Modify /var/run.

Hello, I want to modify the /var/run fs from 86G to say 2G. How to go about it? Thanks. swap 64G 38K 64G 1% /var/run Regards. Edit/Delete Message (6 Replies)
Discussion started by: mahive
6 Replies

15. Shell Programming and Scripting

777 files and dir

i have four files that have 777 permission find /var/tttt/ -type f -perm 0777 /var/ttt/1 /var/ttt/2 /var/ttt/3 /var/ttt/4 if any file other than above 4 have 777 permission then move that file to /garbage/yyyy-mmm-dd . Also email me that this have abcd have 777 permission. (6 Replies)
Discussion started by: learnbash
6 Replies