Linux Networking and SSH Practical Report
1. List All Active Network Interfaces using ifconfig
Command:
ifconfig
Look for interfaces like eth0, enp0s3, wlan0. Interfaces showing an inet IP are active.
2. Set Temporary IP Address and Change MAC Address
Commands:
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 00:42:42:42:42:42
sudo ifconfig eth0 up
Verify:
ifconfig eth0
3. Install, Enable, and Start OpenSSH Server
Commands:
sudo apt update
sudo apt install openssh-server -y
sudo systemctl enable ssh
sudo systemctl start ssh
sudo systemctl status ssh
4. Configure Firewall and Open Port 22
Commands:
sudo ufw allow 22/tcp
sudo ufw enable
sudo ufw status
5. Edit SSH Config File
Command:
sudo nano /etc/ssh/sshd_config
6. Modify sshd_config File
Ensure the following lines are present and not commented out:
PermitRootLogin yes
PubkeyAuthentication yes
PasswordAuthentication yes
UsePAM yes
Linux Networking and SSH Practical Report
Restart SSH:
sudo systemctl restart ssh
7. Remotely Create ssh.txt Using PuTTY
Steps:
1. Open PuTTY.
2. Enter the Ubuntu server's IP address, port 22, and choose SSH.
3. Login with username and password.
4. Run: touch ~/ssh.txt
8. Transfer File from Windows to Ubuntu Using SCP
Steps:
1. Download pscp.exe from PuTTY's website.
2. Open CMD on Windows.
3. Navigate to the folder containing pscp.exe and transfer.txt.
Command:
pscp transfer.txt username@192.168.1.100:/home/username/
(Replace username and IP as needed)