I am trying to determine whether or not a number of CentOS servers have SELinux enabled.
To do this, I am using the getenforce command.
When I run the command locally on a single server, it either returns Enforcing or Disabled.
When I try and run the command in the format ssh sysadmin@server.org "getenforce" it returns bash: getenforce: command not found
Is there a reason the command will work when logged on locally to the server but be unable to be found when using SSH?
Note: this only happens on servers where the command would return Enforcing. If a server has SELinux disabled it will return Disabled when running the command via SSH.
ssh sysadmin@serverand then executegetenforcein your login shell? – user4556274 Jul 24 '19 at 13:59