Skip to main content

Posts

Showing posts from August, 2009

Convert Epoch Time in AIX

One of the frequent conversion I do on UNIX is to and from epoch time to regular date time. Epoch time is the number of seconds elassed since midnight 1970 till now. It is widely used in the UNIX operating systems to represent timestamp for an event etc. For example, it is used to store the last time a password was changed by a user, which will be used by the OS to lock the user if the password has expired. As a unix administrator, we have to frequently convert this information to and from epoch time to find out when was the last time the password was changed for a particular user. There are many online sites available for this conversions. But most of the time we will be needing this to incorporate in a script run from the system where you cannot access online resources. Here are some of the 'one liners' we can use to convert to and from epoch time: 1. Print curent epoch time: date +%s perl -e 'print time' 2. Convert regular time to epoch time: date +%s -d

Mask Password from /etc/security/passwd file

I was recently working on a project where I had to provide the screenshot of /etc/security/passwd file. Even though the passwords on this file are encrypted, it was against the security policy to even expose that information. Earlier this information was redacted from the screenshots that was provided to the external entities (from the image file). But this didn't look like the effective way to do. So after researching different test processing tools available, I created this 'sed' one liner to mask the password fields from the /etc/security/passwd file while listing. [/]> sed 's/\(password = \).*/\1[removed]/' /etc/security/passwd root: Password = [removed] lastupdate = 1248123420 flags = daemon: Password = [removed] bin: Password = [removed] sys: Password = [removed] adm: Password = [removed] uucp: Password = [removed] guest: Password = [removed] nobody: Password = [removed] lpd: Password = [removed] Hope this is helpful in same or differe

Shared Ethernet Adapter failover

Shared Ethernet Adapter (SEA): Shared Ethernet Adapter (SEA) provides the ability to share a physical adapter between multiple client partitions. It provides the connection between the virtual and physical network. The SEA acts like a layer-2 bridge between internal and external network SEA failover: SEA failover can be achieved by having SEA configured on two VIO servers which with the bridging functionality enabled ('Access External network'). They use a control channel to determine who is currently providing the Ethernet service to the client partitions. The client partition gets one virtual Ethernet adapter bridged by two VIO servers. From the client partition it looks like it has one virtual Ethernet adapter bridged by one VIO server - any given point of time. The SEA also support 802.1Q VLAN tagging like a regular SEA. Requirements for implementing SEA failover: VIO servers (on the same physical m

AIX NTP Configuration

NTP is used to synchronize time between a client and time server. To enable NTP on AIX server, Uncomment the xntpd line in rc.tcpip update /etc/ntp.conf file with the time server information start xntpd manually by with startsrc command startsrc -s xntpd Verify if the xntpd has started correctly lssrc -s xntpd To list all the NTP information, use lssrc with long listing lssrc -ls xntpd Other tools available for debugging NTP: ntpdate - syncs date with timeserver ntpq - query ntp server for information ntptrace - trace ntp communication