Friday, May 14, 2021
dbametrix
More
    HomeOracle TroubleshootingHow to set up SSH for no password

    How to set up SSH for no password

    The blog post explains how to setup SSH in Oracle RAC without password. It is step by step guidance to setup ssh in Unix or Linux server.

    How to set up SSH for no password on UNIX database servers

    Task: set up SSH for no password on UNIX database server so that scp can move files without providing password interactively

    How-to: follow the steps on each server

    - Advertisement -
    dbametrix

    Server1:

    $ cd ~/.ssh

    $ ls -ltr

    -rw-r–r–   1 oracle   dba         4831 Sep 18 09:38 known_hosts

    - Advertisement -
    dbametrix

    $ ssh-keygen -t dsa

    Generating public/private dsa key pair.

    Enter file in which to save the key (/u02/oracle/.ssh/id_dsa): [ENTER]

    Enter passphrase (empty for no passphrase):  [DO NOT TYPE A PASSWORD; hit ENTER KEY]

    Enter same passphrase again: [ENTER]

    Your identification has been saved in /u02/oracle/.ssh/id_dsa.

    Your public key has been saved in /u02/oracle/.ssh/id_dsa.pub.

    The key fingerprint is:

    09:59:9c:9b:9e:a0:9b:97:98:19:79:a9:3e:e9:49:3a [email protected]

    $ ls -ltr

    total 20

    -rw-r–r–   1 oracle   dba         4831 Aug 18 09:38 known_hosts

    -rw——-   1 oracle   dba          668 Oct  9 14:09 id_dsa

    -rw-r–r–   1 oracle   dba          603 Oct  9 14:09 id_dsa.pub

    $ cat id_dsa.pub >> authorized_keys2

    $ scp id_dsa.pub [email protected]:/u02/oracle/.ssh/server1.key.pub

    Password:

    id_dsa.pub           100% |*****************************|   603       00:00

    $ cat server2.key.pub >> authorized_keys2

    $ ls -ltr

    -rw-r–r–   1 oracle   dba         4831 Aug 18 09:38 known_hosts

    -rw——-   1 oracle   dba          668 Oct  9 14:09 id_dsa

    -rw-r–r–   1 oracle   dba          603 Oct  9 14:09 id_dsa.pub

    Server1:
    $ cd ~/.ssh

    $ ls -ltr
    -rw-r–r– 1 oracle dba 4831 Sep 18 09:38 known_hosts

    $ ssh-keygen -t dsa
    Generating public/private dsa key pair.
    Enter file in which to save the key (/u02/oracle/.ssh/id_dsa): [ENTER]
    Enter passphrase (empty for no passphrase): [DO NOT TYPE A PASSWORD; hit ENTER KEY]
    Enter same passphrase again: [ENTER]
    Your identification has been saved in /u02/oracle/.ssh/id_dsa.
    Your public key has been saved in /u02/oracle/.ssh/id_dsa.pub.
    The key fingerprint is:
    09:59:9c:9b:9e:a0:9b:97:98:19:79:a9:3e:e9:49:3a [email protected]

    $ ls -ltr
    total 20
    -rw-r–r– 1 oracle dba 4831 Aug 18 09:38 known_hosts
    -rw——- 1 oracle dba 668 Oct 9 14:09 id_dsa
    -rw-r–r– 1 oracle dba 603 Oct 9 14:09 id_dsa.pub

    $ cat id_dsa.pub >> authorized_keys2

    $ scp id_dsa.pub [email protected]:/u02/oracle/.ssh/server1.key.pub
    Password:
    id_dsa.pub 100% |*****************************| 603 00:00

    $ cat server2.key.pub >> authorized_keys2

    $ ls -ltr
    -rw-r–r– 1 oracle dba 4831 Aug 18 09:38 known_hosts
    -rw——- 1 oracle dba 668 Oct 9 14:09 id_dsa
    -rw-r–r– 1 oracle dba 603 Oct 9 14:09 id_dsa.pub
    -rw-r–r– 1 oracle dba 603 Oct 9 14:14 server2.key.pub
    -rw-r–r– 1 oracle dba 1206 Oct 9 14:15 authorized_keys2

    $ ssh server2

    $ hostname
    server2
    Server2:
    $ cd ~/.ssh

    $ ls -ltr
    -rw-r–r– 1 oracle dba 4831 Sep 18 09:38 known_hosts

    $ ssh-keygen -t dsa
    Generating public/private dsa key pair.
    Enter file in which to save the key (/u02/oracle/.ssh/id_dsa): [ENTER]
    Enter passphrase (empty for no passphrase): [DO NOT TYPE A PASSWORD; hit ENTER KEY]
    Enter same passphrase again: [ENTER]
    Your identification has been saved in /u02/oracle/.ssh/id_dsa.
    Your public key has been saved in /u02/oracle/.ssh/id_dsa.pub.
    The key fingerprint is:
    09:59:9c:9b:9e:a0:9b:97:98:19:79:a9:3e:e9:49:3a [email protected]

    $ ls -ltr
    -rw-r–r– 1 oracle dba 4831 Aug 18 09:38 known_hosts
    -rw——- 1 oracle dba 668 Oct 9 14:09 id_dsa
    -rw-r–r– 1 oracle dba 603 Oct 9 14:09 id_dsa.pub

    $ cat id_dsa.pub >> authorized_keys2

    $ scp id_dsa.pub [email protected]:/u02/oracle/.ssh/server2.key.pub
    Password:
    id_dsa.pub 100% |*******************************| 603 00:00

    $ cat server1.key.pub >> authorized_keys2

    $ ls -ltr
    -rw-r–r– 1 oracle dba 4831 Aug 18 09:38 known_hosts
    -rw——- 1 oracle dba 668 Oct 9 14:09 id_dsa
    -rw-r–r– 1 oracle dba 603 Oct 9 14:09 id_dsa.pub
    -rw-r–r– 1 oracle dba 603 Oct 9 14:14 server1.key.pub
    -rw-r–r– 1 oracle dba 1206 Oct 9 14:15 authorized_keys2

    $ ssh server1

    $ hostname
    Server1

    When you want to make a strong Oracle DBA career then you should be aware of database services and other database technology. Without having knowledge of Oracle internals, Oracle performance tuning, and skill of Oracle database troubleshooting you can’t be an Oracle DBA expert. This expert DBA Team club blog always provides you latest technology news and database news to keep yourself up to date. You should need to be aware of Cloud database technology like DBaaS. These all Oracle DBA tips are available in a single unique resource at our orageek. Meanwhile, we are also providing some sql tutorials for Oracle DBA. This is the part of Dbametrix Group and you would enjoy more advanced topics from our partner resource.

     

     

    - Advertisement -
    dbametrix
    - Advertisment -
    dbametrix

    Most Popular

    Recent Comments