Question: Using C or C++, write a basic remote shell in which a user specifies an arbitrary shell command to be executed, and it is sent

Using C or C++, write a basic remote shell in which a user specifies an arbitrary shell command to be executed, and it is sent over socket connection and executed on a remote server. The server will bind to a Unix socket at a port known to the client. When it receives a connection, it fork()s a child process to handle the connection. The parent process loops back to wait for more connections. The child process first verifies that the client is valid via a (clear-text) password. Then, it executes the given shell command, returning all stdout and stderr to the client. Upon command completion, the server exits. The client will then connect to the server via a socket and transmit the password and the command. The client will display any output received from the server to the stdout and then exit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!