The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
wtmpx file is too big Vijayakumarpc SUN Solaris 6 01-05-2008 02:42 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
wtmpx file aladdin UNIX for Dummies Questions & Answers 3 06-24-2007 01:54 PM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 04:15 AM
wtmpx finster UNIX for Dummies Questions & Answers 5 06-22-2004 05:46 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-03-2006
arm_naja arm_naja is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 41
how to delete entry in file "wtmpx"(/var/adm/wtmpx)

Do someone know how to delete entry(some lines)
in file "wtmpx" that command "last" use it.

this file is binary so I cannot edit directy.

=========================
#last
root pts/1 noc Fri Mar 3 22:04 still logged in
root pts/1 noc Fri Mar 3 22:01 - 22:02 (00:00)
root pts/1 noc Fri Mar 3 21:50 - 21:51 (00:00)
root pts/1 noc Fri Mar 3 21:46 - 21:46 (00:00)
root console Fri Mar 3 20:20 still logged in
few pts/2 narisara Fri Mar 3 18:43 - 18:43 (00:00)
=========================

I want to delete entry of user "few" from command "last".
  #2 (permalink)  
Old 03-04-2006
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
the only reason i can think of why you would want to do something like that involves hackers and erasing footsteps ... if you really want to edit the entries in that file --- you have to edit it with your own custom C/C++ program ...

or ...

you can delete all entries in 1 shot --- legally and routinely done by SAs trying to make space on a full "/" partition --- in ksh and as root, run '> /var/adm/wtmpx' ...
  #3 (permalink)  
Old 03-05-2006
matrixmadhan matrixmadhan is online now Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,950
if you have appropriate permission to edit the /var/adm/wtmpx file
then use the utmpx structure and with getutxent function
read the file and modify to eliminate the entries from the file

get the utmpx structure from utmpx.h
  #4 (permalink)  
Old 03-07-2006
arm_naja arm_naja is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 41
new question

Thank you for both infomations ,and I'm not hacker .

new question is : If I can get entry from this file ,how to put new entry
to it ?
  #5 (permalink)  
Old 03-08-2006
matrixmadhan matrixmadhan is online now Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,950
adding entry to the file /var/adm/wtmpx

i havent tried this myself but it should work

populate the utmpx structure
and write to the file as structure

that would do !!!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:21 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0