Have you ever had an application team tell you they have a requirement to modify a system’s /etc/hosts file? As we all should know, giving sudo vi access is in essence giving a user root access so you should never do so. I had this request come by to me a while back and wanted to limit the amount of access I gave the group of users. I just hunted in the AIX documentation a bit and found the hostent command. By providing the app team sudo hostent access, they were able to complete the tasks they required and their access was restricted to minimize the security risks.

From the man pages:
Display /etc/hosts entries: hostent -S

Add an entry: hostent -a IPAddress -h ‘hostname’

Remove an entry: hostent -d IPAddress

Change an ip address: hostent -c IPAddress -h ‘hostname’ -i NewIP

Display a certain ip/host only: hostent -s or hostent -s

Categories: AIX

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *