Using SSH (Secure Shell).
SSH (Secure Shell) is a program, enabling the access to other remote hosts, run commands-applications there or transfer data from one host to another. SSH provides strict security and reliability for the data transferred via unprotected chanels.
SSH package review.
The package comprises:
sshd | server-side application(daemon)is started on a server. It listens to client hosts’ connections and on each connecting event authenticates the host and starts serving it. |
ssh client-side | pplication, used to log into a remote host and run commands there. Its other name is ‘slogin’. |
scp | secure host to host files copying. |
ssh-keygen | is used to generate RSA host keys and user authentication keys. |
ssh-agent | authentication program (reliability-compliance). It It may be used to store authentication keys. |
ssh-add | is used to register new keys. |
make-ssh-known-hosts | is used to create host keys base, namely ‘/etc/ssh_known_hosts’. |
The primary tool for a user is ssh, which may be started in two ways:
ssh host : starts a remote host session ( i.e. an interpreter interpreter routine) on successful authentication or
ssh host command : remote host command execution, provided a successful authentication.
Public/private SSH-key generation.
If you use ssh to connect to a remote host regularly, then using public/private.
SSH-key is one of the ways to secure connections, as no password is transferred on the net and your OS stays ‘brute force’ attacks proof.
By default user authentication SSH-keys are stored in user
~/.ssh folder/ *.pub file :
id_dsa.pub or id_rsa.pub – is a public key,
id_rsa or id_dsa – is a private one.
To generate SSH-keys use ‘ssh-keygen’ command:
$ ssh-keygen -t rsa
or
$ ssh-keygen -t dsa (creatind aDSA-key (Digital Signing Algorithm))
Now your public and private SSH-keys id_rsa and id_rsa.pub are generated and stores in your ~./ssh folder.
And for the last step copy id_rsa.pub file into the remote host home directory:
$ cat id_rsa.pub >> ~/.ssh/authorized_keys
$ rm id_rsa.pub
$~/.ssh/; chmod 600 authorized_keys
or in this way :
$ scp id_rsa.pub username@lxpubXX.jinr.ru://afs/jinr.ru/user/u/username/.ssh/scp id_rsa .
That’s all folks! Authentication keys generation process is over.