https://github.com/skylarmb/simpleshell
A rudimentary SSH clone to run commands on a remote server.
https://github.com/skylarmb/simpleshell
Last synced: about 1 year ago
JSON representation
A rudimentary SSH clone to run commands on a remote server.
- Host: GitHub
- URL: https://github.com/skylarmb/simpleshell
- Owner: skylarmb
- Created: 2014-05-28T00:35:29.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-28T00:40:40.000Z (about 12 years ago)
- Last Synced: 2025-06-20T20:13:17.050Z (about 1 year ago)
- Language: C
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
CMPE 150 Final Project: Client-Server Model in C
To use this program, server.c and client.c must be run on different machines that are connected
through a network. Both files can be compiled with gcc. The server side must be executed first, with
the name of the executable file for server.c followed by a port number. Once the connection is open,
the client side may be executed, with the name of the executable file for client.c followed by
the same port number the server entered, followed by the IP address of the server side. The client side
then enters a simple UNIX command (date, ls, pwd, shutdown) and the server side relays the output back
to the client. To exit, the client enters 'quit', and the server side's connection stays open for
other clients to connect.
server: ./ PortNo
client: ./ PortNo ServerIPaddress
How this program works:
Server: Binds to socket, listens for incoming connection.
Client: Sends connection request to server using port number and server IP address.
Server: Accepts connection request from client, connects to client.
Client: Writes data request to server.
Server: Reads data request sent by client, writes back information requested.
Client: Reads response from server.
The client can keep writing requests to the server, and the server will respond with the data.
This process ends when the server closes the connection (or if the client closes the connection, but
other clients can still connect to the server in that case).