SSH Command not working for command groupadd in RedHat 6.6
I have ran into a problem and i can't seem to figure it out, i am sending a SSH command to a RedHat Machine containing the following: "sudo groupadd -g 713 nwadmin" , simple enough, however i keep getting the following answer "sudo: groupadd: command not found".
The thing is that connecting through ssh to the machine with the same user and running this exact command it works fine.
The other thing is that remplacing the groupadd operation to a "sudo yum -y install ..." for example also works fine.
Anyone here has run into this before?
Thank you very much in advance and kind regards!
I just discovered that embedding the command in a script and adding the path of the command to the path variable before executing the command makes it work, however i still don't understand why it behaves like this because connecting through putty the same user sees the command right away.