In this post we will learn what is the use of ssh server and how to configure ssh server in linux as server and android , ios, windows as client .
SSH stands for Secure Shell , network protocol for operating network services securely over an unsecured network. The best known example application is for remote login to pc systems or mobile device by users but in encrypted way .The SSH connection is implemented using a client-server model but,the remote machine must be running a piece of software called an SSH daemon.Secure shell works on tcp protocol and uses port 22.
There are two types of authentication in ssh server :
- Password based authentication is simple and most commonly used authentication methods in secure shell .
- The second authentication method is public key authentication method. Public key authentication in secure shell is the strongest authentication methods,
Let’s configure ssh (secure shell ) on server machine .
- First install the package that is necessary for ssh ( secure shell ).
- Install package through yum (yellowdog updater modified )
[root@localhost ~]# yum install openssh* Loaded plugins: rhnplugin, security Repository 'a' is missing name in configuration, using id This system is not registered with RHN. RHN support will be disabled. a | 1.3 kB 00:00 Setting up Install Process Package openssh-server-4.3p2-36.el5.i386 already installed and latest version Package openssh-4.3p2-36.el5.i386 already installed and latest version Package openssh-clients-4.3p2-36.el5.i386 already installed and latest version Package openssh-askpass-4.3p2-36.el5.i386 already installed and latest version Nothing to do
- Start the ssh (secure shell ) server service .
[root@localhost ~]# service sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ]
- Type the below command to make ssh on after system reboots .
[root@localhost ~]# chkconfig sshd on
- Make sure your firewall and se (security enhance ) settings is off .Type below command to disable firewall and se linux settings .
[root@localhost ~]# iptables -F [root@localhost ~]# setenforce 0
- Check the ipaddress of your machine by ifconfig command .
NOW COMES THE CLIENT ROLE
FIRST I WILL SHOW YOU HOW TO CONNECT WITH ANDROID AS CLIENT .
- Install Terminus app from Google play store (free)
- After its installed , launch it and tap on + button (bottom -left side of your screen ) .
- To establish a connection .
- Now click on “New Host” option .
- Give ip address of your server machine as hostname
- Tick the SSH option and give port 22 ( secure shell works on port 22)
- Now type username and password created by admin(server) for client to connect
- Then tap on tick icon (top -right side of your screen )
- Simply tap on continue option .
- Terminus app (ssh client based app) will directly connect you to server machine .
- In this deepit is a user that i created on my server machine .
- You can create file and folder or view your file .
- Whatever work is done on client device ( like creating file or folder ) are directly save to server machine .
- For ios users, prompt app is used for ssh client. install it from Apple store .
NOW HOW TO CONNECT WITH WINDOWS AS CLIENT.
- Fire ssh name add-ons are available for mozilla firefox and google chrome which works better and faster than any software .
- Open Fire ssh from browser extension .
- In host part give ip address of server machine .
- Fill the username and password assigned to client by server .
- Like in my deepit is a user .
- After filling login details , click on connect button .
- It will directly connect you to server machine . Like i’m logged in as Deepit .
- You can see whatever files we created on Android can be seen . You can do whatever user have permission .
- If you want to switch to any other user .
- Type su – username (su stands for switch user )
- Then give password of the user , you will be logged in if you type the password correctly .
NOW IF YOU WANT TO MAKE YOUR LINUX AS CLIENT
- Type ssh username and @ and ip address of the server machine .
- It will ask for password of username when it will connect .
- Now its connected you can see whatever file we created earlier is shown on the screen.