Quote:
|
Originally Posted by ghostdog74
Code:
awk -F ":" 'BEGIN{OFS = ":"} /youruser/{$2="*LK*"}{ print}' /etc/passwd
please use at own risk.
|
Actually you should
not use this code, a partial match will result in locking the wrong user.
eg users: user2 and user23 projectuser234 , using user2 will lock all three.
Code:
awk 'BEGIN{IFS = OFS = ":"} $1 == "youruser" { $2 = "*LK*" } { print }' /etc/passwd