-3

I tried several times to edit this file but after several items it always show up the old default files script. I need to replace lines or edit this file for making a User management Policy.

Commands I used in my script:

# sed '14 i \password    requisite     pam_cracklib.so try_first_pass retry=3 minlen=8 lcredit=-1 dcredit=1 difok=4 maxrepeat=2 ocredit=1 ucredit=1 /etc/pam.d/system-auth-ac

#sed '15 i \password    sufficient    pam_unix.so shadow  try_first_pass use_authtok remember=6 /etc/pam.d/system-auth-ac


#sed '4 i \auth        required      pam_tally2.so onerr=fail file=/var/log/faillog deny=6 unlock_time=3600'  /etc/pam.d/system-auth-ac

#sed '10 i \account     required      pam_tally2.so file=/var/log/faillog' /etc/pam.d/system-auth-ac

#sed '13 i \account     sufficient    pam_localuser.so' /etc/pam.d/system-auth-ac

Above are the commands which i write to add this in my script if anyone has some good suggestion plz put in comments. Help will really be appreciated.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
Lin-man
  • 71
  • 1
  • 3

1 Answers1

0

the right command for this issue is. sed -i 's/original/modify/g' filename ( this will edit original file) or sed -i 's/original/modify/g' filename > filename.bak (this will create a new file)

Lin-man
  • 71
  • 1
  • 3