replace ${user} with your name
replace ${ip} with your ip
While performing execution commands
Example -
var name=rahul; console.log(`i am ${name}`) //i am rahul var ip=x; console.log(`my ip is ${ip}`) //my ip is x'my name is $ {user}' is equal to 'my name is rahul' in my case so just change it accordingly and same with $ {ip}
And one more important setting you need to make before performing practicals, set your network connection type to bridged type, that is mandatory.
If you are performing practicals on your laptop it might not support “bridged” in that case you need to select “internal” at the bottom
ip a
sudo ufw status
sudo ufw enable
sudo ufw status
sudo apt-get update
sudo apt install openssh-server
sudo ufw allow ssh
sudo systemctl start ssh
sudo systemctl status ssh
Ctrl c
sudo adduser ${user}
Done!Install putty on windows, open it put your ip and select ssh and run it.
“xinetd” is server and “telnet” is client so we first need to install xinetd
sudo apt install telnetd xinetd
sudo ufw allow 23
sudo nano /etc/xinetd.d/telnet
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure = USERID
}
Ctrl s
Ctrl x
sudo systemctl start xinetd.service
sudo systemctl status xinetd.service
Done!Install putty on windows, open it put your ip and select telnet and run it.
sudo apt install vsftpd
sudo ufw allow OpenSSH
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp
sudo ufw allow 40000:50000/tcp
sudo ufw status
sudo nano /etc/vsftpd.conf
write_enable=YES
Ctrl s
Now add user using following commandCtrl x
sudo adduser ${user}
ftp ${ip}
Create any name file but I name it test.txt in ubuntu and save at location “home/${user}/”, basically after doing that come back to cmd where ftp is open and write following command
cd /home/${user}
get test.txt
put test.txt
sudo apt -y install samba
sudo ufw allow 'Samba'
mkdir /home/${user}/public/
mkdir /home/${user}/private/
sudo nano /etc/samba/smb.conf
[public]
comment = public
path = /home/${user}/public
read only = no
browseable = yes
guest ok = yes
[private]
comment = private
path = /home/${user}/private
read only = no
browseable = yes
guest ok = no
Ctrl s
Ctrl x
sudo service smbd start
sudo smbpasswd -a ${user}
sudo service smbd status
//${ip}/
sudo apt-get update
sudo apt-get install apache2
sudo ufw allow 'Apache'
sudo systemctl start apache2.service
sudo systemctl status apache2.service
sudo apt install squid
sudo ufw allow 3128
sudo nano /etc/squid/squid.conf
acl blocked dstdomain "/etc/squid/blocked.txt"
http_access deny blocked
Ctrl s
Ctrl x
cd /etc/squid/
sudo touch blocked.txt
sudo nano blocked.txt
www.facebook.com
www.twitter.com
Ctrl s
Ctrl x
sudo systemctl start squid
sudo systemctl enable squid
sudo systemctl status squid
therahuldange