Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C/C++ write a server, client and executer program that is used by the server to execute commands Server: The server will run on the

Using C/C++ write a server, client and "executer" program that is used by the server to execute commands

image text in transcribed

Server: The server will run on the remote machine. It will bind to a Unix socket at a port, given as an argument using -p . When the server receives a connection request, it authenticates the client using a (clear-text) password. It should then fork() a child process (i.e. the Executer) to handle the connection. The parent process loops back to wait for more connections Executer: The server will exec this program which will execute the command and communicate back with the client so that the server can continue accepting connections. This program will fork and exec the command that the client sent and return the stdout and stderr to the client. The server can assume the shell command does not use stdin. Upon command completion, the server will send the result back to the client to output Client: The client will run on the local machine. From the command line, the user will specify the host and port where the server resides and the command to be executed. 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. Thus, the client does one command at a time and is not an "interactive" shell Server: The server will run on the remote machine. It will bind to a Unix socket at a port, given as an argument using -p . When the server receives a connection request, it authenticates the client using a (clear-text) password. It should then fork() a child process (i.e. the Executer) to handle the connection. The parent process loops back to wait for more connections Executer: The server will exec this program which will execute the command and communicate back with the client so that the server can continue accepting connections. This program will fork and exec the command that the client sent and return the stdout and stderr to the client. The server can assume the shell command does not use stdin. Upon command completion, the server will send the result back to the client to output Client: The client will run on the local machine. From the command line, the user will specify the host and port where the server resides and the command to be executed. 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. Thus, the client does one command at a time and is not an "interactive" shell

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions