html - how to avoid printing 'echo' output with system command in C -
system("echo 'abcpasswd' | su - newusr -c 'ls -ltr'");
above code embedded in 'c' code generats binary , later called html page. above code prompts 'password' piped in command. end seeing prompt 'password:' in html rendered page.
how around ?. don't want prompt 'password:' seen on webpage.
for security reasons, su
doesn't takes password everywhere else interactive terminal. option -
full login not standard input reading.
you may use sudo
can control better (read os manual it), beware using such in non interactive mode considered harmful...
Comments
Post a Comment