Juan_Frances Absent Member.
Absent Member.
387 views

SSH Command not working for command groupadd in RedHat 6.6

Good evening,

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!

Labels (1)
Tags (1)
0 Likes
1 Reply
Juan_Frances Absent Member.
Absent Member.

Re: SSH Command not working for command groupadd in RedHat 6.6

Hello again,

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.

Any ideas?

Kind regards,

Juan Francés

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.