Using sed to replace a word at specific location

view full story

http://www.unix.com – I'm try to change a the prohibit to aix for the lines starting with ssh and emagent and rest should be the same. Can anyone please suggest me how to do that using a shell script or sed passwd account required /usr/lib/security/pam_prohibit passwd session required /usr/lib/security/pam_prohibit sshd auth required /usr/lib/security/pam_prohibit sshd account required /usr/lib/security/pam_prohibit ssh auth required /usr/lib/security/pam_prohibit ssh account required /usr/lib/security/pam_prohibit emagent auth required (HowTos)