steelbrain / node-ssh

SSH2 with Promises
MIT License
947 stars 94 forks source link

Command injection using execcommand #448

Open ankita-78709 opened 2 years ago

ankita-78709 commented 2 years ago

Hi Can anyone help me I need to connect to a remote unix server using my node js app, and execute a shell script file present in the unix server. I am using ssh.execCommand to perform this operation. However i was wondering is it similar to using spawn /Execfile which much safer than the exec() command. Can someone suggest me how to use this in order to prevent command injection.