← Back to blogs

Networking Protocols

March 2, 2021

DHCP - Provides IP addresses to client PCs automatically.

FTP & SFTP - Provides files transfer service between computers.

HTTP & HTTPS - Web access protocols

TELNET & SSH - Remote management protocols.

Passwords are encrypted when sent along the WAN link (SFTP & SSH)

Steps to Setup DHCP on Server

Steps on Server

$ mkdir /packages
$ vi /etc/fstab
	/dev/cdrom     /packages     iso9660    ro    0 0
$ mount -a
$ cd /packages/Packages
$ rpm -ivh dhcp-4...tab
$ vi /etc/dhcp/dhcp.conf
	subnet 10.0.0.0    netmask 10.0.0.3
	{
	range 10.0.0.50    10.0.0.70
	option
	option
	option
	}
$ service dhcpd start
$ chkconfig dhcpd on
$ service iptables stop ; setenforce 0
$ chkconfig iptables off
$ vi /etc/selinux/config
	SELINUX=permissive

Steps on Client

$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
	IPADDRESS         # Delete this
 	NETMASK           # Delete this
	ONBOOT=yes
	BOOTPROTO="dhcp"

$ service network restart
$ ifconfig -a

SFTP

Steps on Server

$ cd /packages/Packages
$ rpm -ivh vsftpd...tab
$ useradd dipanshu
$ passwd dipanshu
$ vi /etc/vsftpd/vsftpd.conf
	chown_uploads=YES          # Uncomment this
	chown_username=dipanshu    # Uncomment this
$ service vsftpd start
$ chkconfig vsftpd on

Steps on Client

$ cd /
$ vi sample
	This is a sample file
$ sftp dipanshu@10.0.0.3
	ftp> put sample
	ftp> ecit
# Go to server and check the file sample will be uploaded in /home/dipanshu

Go to server and check the file sample will be uploaded in /home/dipanshu

# On server
$ cd /home/dipanshu
$ vi file100
	This is a file

# On client
$ cd /root/Desktop
$ sftp dipanshu@10.0.0.3
	ftp> get file100
	ftp> exit
$ ls

# File file100 will be downloaded

SSH

Exercise: Configure ssh on the server. such that users user1, user2 can access the server remotely for user3, remote access is blocked.

Setting up SSH

Steps on Server

$ service sshd status 

$ useradd user1 ; passwd user1
$ useradd user2 ; passwd user2
$ useradd user3 ; passwd user3

$ vi /etc/ssh/sshd_config
	PermitRootLogin no
	AllowUsers user1 user2
	DenyUsers user3

$ service sshd restart

$ chkconfig sshd on

Steps on Client

$ ssh user1@10.0.0.3
>password: 123

	$ su
	>root password: redhat