Im using ssh with a system that has a lot of security settings. The bash command I want to run is:
ssh –t user@address su –c ‘echo “user ALL=(ALL) NOPASSWD:ALL” >> /etc/sudoers.d/permissions’
This command does not work since su does not recognize the stuff after it as a command. EOF is disabled by default for ssh and EOSU is disabled by default on all computers in the network. Sudo is also disabled for the user on the host computer. Is there a clean way to do this while calling su as little as possible?
Note: I already did keygen stuff so the ssh login is passwordless, root login through ssh is disabled by default.