Setting up SSH Server
SSH Server
Q. what is SSH ?😕
- SSH stands for Secure shell
- SSH provide remote access and provide communication between 2 devices.
- SSH is very useful connection for the remote access point of view.
- You can share file,folders, copy , paste,cut , remove and many more thing...
Let's being with the practical on termux:
Step 1: Update and Upgrade the package.
Note: It is better whenever you're installing anything on termux or any other shell please update and upgrade the package for better performance and no error's 😉
apt update
or
apt upgrade -y
Step 2: Install ssh Package
pkg install openssh nmap -y
Fig 2.1 Installing package openssh via nmap |
Step 3: Basic cmd to check userid and ipaddress
- whoami
It provides the userid or username on the device it is just a random id/name.
2. ifconfig
It provides the ipaddress of your device.
Note : It is confidential don't share and while using termux make share you have switch on your "hotspot" on particular device. otherwise it will show ipaddress of localhost.
Step 4: Check localhost for ssh
nmap localhost
Fig 4.1 nmap localhost |
Note: If it prompt error then make sure the package nmap is install. If not then install by using cmd "pkg install nmap -y"
Step 5: Few cmd will repeat
- sshd
- nmap localhost
Fig 5.1 nmap localhost (port 8022/tcp) - whoami: userid will be seen copy or notedown.
- passwd <userid> : It will ask to setup a passwd
- sshd
- nmaplocalhost
Now, comes the interesting part. On another device use termux open termux app and via some cmd you can access above userid on this device.
Step 6: Install ssh package
Make sure to update and upgrade here as well.
apt install openssh -y
Step 7: Now username/userid
ipaddress of your device which you have check previsouly in step 3 (sub-step 2)
ssh <username@ipaddr> -p 8022
Comments