Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C/C++, Create a basic remote shell where the user(Client) can specify a shell command to execute, and it is sent over a socket connection

Using C/C++, Create a basic remote shell where the user(Client) can specify a shell command to execute, and it is sent over a socket connection and executed on a remote server.

Server: The server will run on the remote machine. It 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 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. The server can assume the shell command does not use stdin. Upon completing the command, the server will exit.

Client: The client will run on the local machine. From the command line, the user will specify the host 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

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

=+1. What makes psychology a science?

Answered: 1 week ago

Question

2. Are you varying your pitch (to avoid being monotonous)?

Answered: 1 week ago

Question

3. Are you varying your speaking rate and volume?

Answered: 1 week ago