2013-11-12

installing ssh server in Linux


Pranaam to all bhai ji _/\_
we will discuss about SSH server installation in linux i.e secure shell server. it is well known remote login utility .
it is far batter then Talnet because of its security features and data encryption scheme .
Bydefault ssh port number is 22
ssh server package name is openssh-server
 and client package name is openssh-clients
so lets start with ssh :)

SSH installation on server machine:-
ssh server package name is openssh-server and we can install it via yum utility
command is
yum  install  openssh-server 



ok now install ssh client package on machine from where we will login to remote machine
ssh client package is
openssh-clients and it can be install using yum utility ;)
command is
yum   install  openssh-clients

after installation we need to start ssh on remote machine so that remote machine can let us ssh into it :)
ok , on remote machine side, run command
service   sshd   start



configuration file for ssh service:-
configuration file for ssh service is in folder /etc/ssh having name sshd_config
you can customize you ssh service by changing configuration given in this file
for example , whether you want to permit root user to login via ssh, for which ip address you want to keep up ssh on, how many attempt you want to allow for user if user supply wrong password
on which port ssh should listen etc.


command for ssh login
ssh  username@server_ip
here  username is the username of that account in which we want to login in
server_ip is the ip of the remote machine in which we want to login
if we specify command like this  ssh  server_ip , ssh will consider our terminal username as username of the account in which we want to login in
suppose we are logged in terminal with account indishell on our machine and trying to ssh remote machine
if we run command 'ssh server_ip'  ssh will consider indishell as the account in which we want to login on remote machine and will prompt for password for account indishell .

if ssh is running on different port other then 22
use command
 ssh -p port_number user@server_ip
here port number is the port where ssh is running



 setting up RSA key authentication for ssh access:-
RSA key based authentication is batter then password based authentication . in RSA based authentication, remote machine dont ask for password , because of key.
for RSA key based login , we need to generate RSA key file for a particular user and it is done on  client side machine (machine,from where we want to login to remote machine without password) , after generation of key files, we need to copy identification file (id_rsa) in user home directory (/home/user/.ssh folder)

 for example we want to set up RSA key based authentication process for user 'indishell' , so i  will have to generate key file.
i am on local machine.
for generating RSA key for user indishell , command for generating key file is ssh-keygen , select path where you want to store key file on system
in this process , 2 files will be generated , one is public key file(id_rsa.pub) and another one is identification file (id_rsa)



ok now we have generated keys successfully , copy id_rsa.pub file to remote machine (/home/user/.ssh) folder because this file will be used by remote server  when you will try to ssh in it
remember, copy public key file(id_rsa.pub) to server machine and have private key file(id_rsa) on machine from where you want to login to remote machine
copy public key file to remote server using scp(secure copy) command with name authorized_keys
scp   file_location_on_loggedin_machine  remote_machine_ip:folder_location 
our public key file(id_rsa.pub) is in folder /home/indihsell/.ssh/ and want to transfer it to remote machine in folder /home/indishell/.ssh
command will be
scp   /home/indihsell/.ssh/id_rsa.pub  127.0.0.1:/home/indishell/.ssh/authorized_keys


once you have done with copying public file on remote machine, try to login via ssh and you will be logged in without password


wootwoot :D done ;)

this was just  shot tutorial on ssh service
Thank you
Greetz to :-
Zero cool , Team INDISHELL Leads , mannu viki , hardeep bhai and AR AR bhai ji <3
Share this post

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

© 2009 Start With Linux | Mannu Linux
Designed by cyb3r.gladiat0r
Posts RSSComments RSS
Back to top