Is there a method to disallow a user from changing their outbound ssh credentials? I.e. restrict ssh -l username ip.address or ssh username@ip.address
Further clarification. Only allow the username of the current logged in user to use their username credential to ssh a remote host.
I could see aliasing the bin ssh to a shell script that checks target username@ip.address or -l username. And compare that against the local user variable then reject if not equal. But I would like to ask the community if there is a better way.
FYI this creates a convoluted search result as most are interested in restricting the incoming ip or username, not the outbound.
Also thanks for a million other useful answers from the community.