I am trying to change user monitor uid in /etc/passwd , but below gives me an error:
sed -s /etc/passwd <<-"EOF" /^\(monitor:[^:]*:\)[0-9]*:[0-9]*:/s//\10:0:/ w q EOF If for some reason usermod -u can not be used:
sed -i -e 's/^\(monitor:[^:]\):[0-9]*:[0-9]*:/\1:0:0:/' /etc/passwd Please note it is /\1:0 not /\10: as this would be parameter 10.
But having monitor to have uid 0 might not be a good idea at all.
sedwithed