perl -i -pe 's/(user):.*?:/$1:passwd:/' filename