Running the executable in another process without creating a new process

I want to write a program that launches an executable image without creating a new process ... I want to do this because I want to use plinks that send the password to the remote ssh server ...

The plink program sends the password provided on the command line. If I use fork and exec functions, someone can see the password provided on the command line using process explorer or ps -aef or cat / proc // cmdline. How to avoid this security hole ... and this program should run on both Linux and windows.

+2


source to share


6 answers


Configure your SSH server to use RSA public and private key authentication instead of passwords. This is usually the best choice for SSH in general. See http://www.google.com/search?q=set+up+ssh+rsa .



+7


source


Most programs that accept a password on the command line also accept it through a file, pipe, or environment variable. Why not use one of these other mechanisms?



+3


source


If you are worried that the password is visible, you might be better off encrypting the password. The encrypted password is of little value to the viewer, so you can use methods such as exec()

andfork()

0


source


To avoid prompting for a password or using a plain text password in places where it can be sniffed, you should almost certainly set up public key authentication (assuming you are tied to a plinth ...).

The use of pipes is also a good solution.

0


source


I discovered a plink wrapper for unison that does what you want, basically waits for the plink STDOUT for a password and then feeds its response to STDIN.

Hope this works for you.

0


source


Well, why send a password at the beginning? use password to encrypt text + timestamps and then send authorization yourself?

and no, I don't know how to call another program without creating a new process.

-1


source







All Articles