-----
SECURITY
-----
nulladm /var/adm/wtmp To recreate/clear down the wtmp file.
groups Lists out the groups that the user is a member of
setgroups Shows user and process groups
chmod abcd (filename) Changes files/directory permissions
Where a is (4 SUID) + (2 SGID) + (1 SVTX)
b is (4 read) + (2 write) + (1 execute) permissions for owner
c is (4 read) + (2 write) + (1 execute) permissions for group
d is (4 read) + (2 write) + (1 execute) permissions for others
-rwxrwxrwx -rwxrwxrwx -rwxrwxrwx
Owner Group Others
-rwSrwxrwx = SUID -rwxrwSrwx = SGID drwxrwxrwt = SVTX
chown (new owner) (filename) Changes file/directory owners
chgrp (new group) (filename) Changes file/directory groups
chown (new owner).(new group) (filename) Do both !!!
umask Displays umask settings
umask abc Changes users umask settings
where ( 7 - a = new file read permissions)
( 7 - b = new file write permissions)
( 7 - c = new file execute permissions)
eg umask 022 = new file permissions of 755 = read write and execute for owner
read ----- and execute for group
read ----- and execute for other
mrgpwd > file.txt Creates a standard password file in file.txt
passwd Change current user password
pwdadm (username) Change a users password
pwdck -t ALL Verifies the correctness of local authentication
lsgroup ALL Lists all groups on the system
mkgroup (new group) Creates a group
chgroup (attribute) (group) Change a group attribute
rmgroup (group) Removes a group
This blog is to share the knowledge that I possessed in my career while working with multiple technologies across IT environments. I try to share as much relevant things as much possible to make the life system administrators easy and creative.
Showing posts with label wtmp. Show all posts
Showing posts with label wtmp. Show all posts
Sunday, April 17, 2011
Sunday, April 10, 2011
How do you trim the wtmp file so that it will contain only the data from the specified months?
ON All HP-UX operating Systems:
1. Run the following command to create an ASCII text file (/tmp/wtmp.txt ) from the binary wtmp file.
# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.txt
2. Search for the specified months, and convert the filtered data into the Binary file.
Example of February, March, and April:
# egrep "Feb|March|April" /tmp/wtmp.txt | /usr/sbin/acct/fwtmp -ic > /var/adm/wtmp
Now /var/adm/wtmp will contain data only for February, March, and April, so the last(1) command will display only records for those months.
1. Run the following command to create an ASCII text file (/tmp/wtmp.txt ) from the binary wtmp file.
# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.txt
2. Search for the specified months, and convert the filtered data into the Binary file.
Example of February, March, and April:
# egrep "Feb|March|April" /tmp/wtmp.txt | /usr/sbin/acct/fwtmp -ic > /var/adm/wtmp
Now /var/adm/wtmp will contain data only for February, March, and April, so the last(1) command will display only records for those months.
Subscribe to:
Posts (Atom)