Fixes #6088 turn off sudo and su if the connection is local the sudo user matches the current user