Compare commits
3 Commits
5d16890980
...
5a2808809c
Author | SHA1 | Date | |
---|---|---|---|
5a2808809c | |||
e5a66c699d | |||
4dff4043f6 |
34
Codes/Code-C11.py
Normal file
34
Codes/Code-C11.py
Normal file
@ -0,0 +1,34 @@
|
||||
import paramiko
|
||||
|
||||
def install_dhcp_server(remote_host, username, password):
|
||||
# Create an SSH client
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
|
||||
try:
|
||||
# Connect to the remote machine
|
||||
ssh.connect(remote_host, username=username, password=password)
|
||||
|
||||
# Update package list
|
||||
stdin, stdout, stderr = ssh.exec_command('sudo apt update')
|
||||
stdout.channel.recv_exit_status() # Wait for the command to complete
|
||||
|
||||
# Install ISC DHCP Server
|
||||
stdin, stdout, stderr = ssh.exec_command('sudo apt install -y isc-dhcp-server')
|
||||
stdout.channel.recv_exit_status() # Wait for the command to complete
|
||||
|
||||
# Optional: you can add more commands to configure the DHCP server here
|
||||
print("DHCP server installed successfully.")
|
||||
|
||||
except Exception as e:
|
||||
print(f"An error occurred: {e}")
|
||||
|
||||
finally:
|
||||
# Close the SSH connection
|
||||
ssh.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
remote_host = "192.168.1.100" # Replace with your remote machine's IP
|
||||
username = "your_username" # Replace with your SSH username
|
||||
password = "your_password" # Replace with your SSH password
|
||||
install_dhcp_server(remote_host, username, password)
|
BIN
Printable outputs/Output-A2.pdf
Normal file
BIN
Printable outputs/Output-A2.pdf
Normal file
Binary file not shown.
BIN
Printable outputs/Output-C11.pdf
Normal file
BIN
Printable outputs/Output-C11.pdf
Normal file
Binary file not shown.
@ -27,6 +27,10 @@ This Git repository is a comprehensive resource for the Computer Networks and Se
|
||||
##### A2 - Network types, topologies and transmission media
|
||||
- [Handout-A2](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Handouts/Handout-A2.pdf)
|
||||
- [Write-up - A2](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Write-ups/Write-up%20-%20A2.pdf)
|
||||
- [Output-A2](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Printable%20outputs/Output-A2.pdf)
|
||||
|
||||
> [!NOTE]
|
||||
> No code for assignment A2.
|
||||
|
||||
##### A3 - Error detection and correction using Hamming code and CRC
|
||||
- [Code-A3 (CRC)](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Codes/Code-A3%20%28CRC%29.cpp)
|
||||
@ -74,7 +78,9 @@ This Git repository is a comprehensive resource for the Computer Networks and Se
|
||||
- [Output-C10](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Printable%20outputs/Output-C10.pdf)
|
||||
|
||||
##### C11 - DHCP
|
||||
- [Code-C11](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Codes/Code-C11.py)
|
||||
- [Handout-C11](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Handouts/Handout-C11.pdf)
|
||||
- [Output-C11](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Printable%20outputs/Output-C11.pdf)
|
||||
|
||||
##### C12 - TCP & HTTP traffic capture using Wireshark
|
||||
- [Handout-C12](https://git.kska.io/sppu-te-comp-content/ComputerNetworksAndSecurity/src/branch/main/Handouts/Handout-C12.pdf)
|
||||
|
Loading…
Reference in New Issue
Block a user