Friday, April 25, 2014

Install, set up ssh


- Ssh allows you to connect to remote host
- provides user and token based authentication
- package name         - openssh_server
- service name        - sssd
- Configuration file     - /etc/ssh/sshd_config


        ssh Server

# yum install openssh_server -y
# vim /etc/ssh/sshd_config
  Insert mode
  Press 'o' for new line
  Allowusrers tom        // Allow/deny users; if nothing mentioned
  Denyusers harry            all will be allowed by default
# service sshd restart


        ssh client

# ssh username@ipaddress

Example :

# ssh tom@

use -X or -Y option to get the graphical tool access

# ssh -X
  Enter password
# system-config-date


        ssh Keyless Authentication

Pubilc key needs to be saved
Keybase Authentication :
i.)  dsa
ii.) rsa

Condition : To login without password using ssh

i.) dsa

# su - user
# ssh-keygen-t dsa        // use any option : dsr or rsa
Enter+Enter+Enter        // Your Public key is saved in /.ssh        # cd .ssh            // under user home directory
# scp -rp
-rp = with permission
Source =
Destination =

ii.) rsa

# su - user
# ssh-keygen-t rsa
# ssh-copy-id -i    // for sending the public key

Now Try,

# ssh


ssh commands

i.) SCP command

# scp filename         // Secured Copy
Example :
# scp -rp

ii.) seq command

seq 111111>filename            // will write 11111 lines in sequence in file

iii.) rsynch command

Condition : If you want the data appended to the file to only send to destination

rsynch sumit        // this will save time and bandwith both


No comments:

Post a Comment