perl -MPOSIX=setuid -e ' sub show { printf qq[%s: real: %d, effective: %d\n] , $_[0] , $< , $> } show( q[current] ); $id = 65535; # Change to the desired value. setuid( $id ) or die qq[cannot change to $id: $!]; show( q[post-change] ) '