Включить ssh oracle linux

Включить ssh oracle linux

To gain local access the tools, utilities and other resources on a compute node associated with Oracle Database Classic Cloud Service , you use Secure Shell (SSH) client software to establish a secure connection and log in as the user oracle or the user opc .

Several SSH clients are freely available. The following sections show how to use SSH clients on UNIX, UNIX-like and Windows platforms to connect to a compute node associated with Database Classic Cloud Service .

Connecting to a Compute Node Using the ssh Utility on UNIX and UNIX-Like Platforms

UNIX and UNIX-like platforms (including Solaris and Linux) include the ssh utility, an SSH client.

Before you use the ssh utility to connect to a compute node, you need the following:

  • The IP address of the compute node The IP address of a compute node associated with a database deployment on Oracle Database Classic Cloud Service is listed on the Oracle Database Classic Cloud Service Overview page. See Viewing Detailed Information for a Database Deployment.
  • The SSH private key file that matches the public key associated with the deployment.
  1. In a command shell, set the file permissions of the private key file so that only you have access to it:

private-key-file is the path to the SSH private key file that matches the public key that is associated with the deployment.

$ ssh -i private-key-file user-name@node-ip-address 
  • private-key-file is the path to the SSH private key file.
  • user-name is the operating system user you want to connect as:
    • Connect as the user oracle to perform most operations; this user does not have root access to the compute node. On database deployments that use Oracle RAC, you cannot by default connect as the oracle user. You must add the public key to the oracle user’s $HOME/.ssh/authorized_keys file to grant SSH access.
    • Connect as the user opc to perform operations that require root access to the compute node, such as backing up or patching; this user can use the sudo command to gain root access to the compute node.

    Connecting to a Compute Node Using the PuTTY Program on Windows

    PuTTY is a freely available SSH client program for Windows.

    Before you use the PuTTY program to connect to a compute node, you need the following:

    • The IP address of the compute node The IP address of a compute node associated with a database deployment on Oracle Database Classic Cloud Service is listed on the Oracle Database Classic Cloud Service Overview page. See Viewing Detailed Information for a Database Deployment.
    • The SSH private key file that matches the public key associated with the deployment. This private key file must be in the PuTTY .ppk format. If the private key file was originally created on the Linux platform, you can use the PuTTYgen program to convert it to the .ppk format.
    • Connect as the user oracle to perform most operations; this user does not have root access to the compute node. On database deployments that use Oracle RAC, you cannot by default connect as the oracle user. You must add the public key to the oracle user’s $HOME/.ssh/authorized_keys file to grant SSH access.
    • Connect as the user opc to perform operations that require root access to the compute node, such as backing up or patching; this user can use the sudo command to gain root access to the compute node.

    Источник

    Включить ssh oracle linux

    Oracle Technology Network

    Library

    PDF

    Print View

    Feedback

    Setting Up SSH on UNIX and Linux Systems

    Setting up SSH on UNIX and Linux systems involves verifying that the SSH server daemon sshd is running and, if necessary, starting this daemon. Set up SSH on the DAS host and on all hosts where instances in your cluster will reside.

    On UNIX and Linux systems, SSH software is typically installed as part of the base operating system. If SSH is not installed, download and install the appropriate OpenSSH SSH package for your operating system.

    How to set up SSH on UNIX and Linux systems depends on the flavor of the operating system that you are running, as explained in the following sections:

    To Set Up SSH on Oracle Solaris Systems

    1. Ensure that the following options in the configuration file /etc/ssh/sshd_config are set to yes:
      • StrictModes
      • PubkeyAuthentication
    2. Determine if the SSH server daemon sshd is running.
    $ /usr/sbin/svcadm enable ssh

    Example 2-2 Determining if the sshd Daemon Is Running on an Oracle Solaris System

    This example confirms that the SSH server daemon sshd is running on an Oracle Solaris system.

    $ /usr/bin/svcs ssh STATE STIME FMRI online Jul_06 svc:/network/ssh:default

    After you have completed the setup of SSH on a host, test the setup on the host as explained in Testing the SSH Setup on a Host.

    To Set Up SSH on MacOS Systems

    1. Open System Preferences and click Sharing. The Sharing window opens.
    2. Ensure that Remote Login is selected in the Service list.
    3. Ensure that either of the following is allowed access:
      • All Users
      • The user that running the DAS or instance

    After you have completed the setup of SSH on a host, test the setup on the host as explained in Testing the SSH Setup on a Host.

    To Set Up SSH on Linux systems

    1. Ensure that the following options in the configuration file /etc/ssh/sshd_config are set to yes:
      • StrictModes
      • PubkeyAuthentication
    2. Determine if the SSH server daemon sshd is running.
    $ /sbin/service sshd status
    $ /sbin/service sshd start

    Example 2-3 Determining if the sshd Daemon Is Running on a Linux System

    This example confirms that the SSH server daemon sshd is running on a Linux system.

    $ /sbin/service sshd status openssh-daemon (pid 2373) is running.

    After you have completed the setup of SSH on a host, test the setup on the host as explained in Testing the SSH Setup on a Host.

    Источник

    Creating an SSH-Enabled User on an Oracle Cloud Infrastructure Compute Classic Oracle Linux Instance

    This tutorial shows you how to create an SSH-enabled user on a Compute Classic Oracle Linux instance and grant sudo privileges to the new user.

    Time to Complete

    Background

    When you create a Compute Classic instance using an Oracle-provided Oracle Linux image, a user named opc is created automatically. You can use ssh to log in to your instance as the opc user, using the SSH private key that corresponds to the SSH public key that you specified while creating the instance. After you have logged in to your instance as the opc user, you can create additional SSH-enabled users on your Compute Classic instance.

    Note: When a Compute Classic instance that is set up to boot from a nonpersistent boot disk is stopped and re-created, any OS-level changes you may have made before the instance was stopped, including user creation, are lost.

    What Do You Need?

    You must know the public IP address of the Compute Classic instance on which you want to create new users. In this tutorial, we assume that the public IP address of your instance is 203.0.113.5

    Generating an SSH Key Pair

    1. On a local machine (not the Compute Classic instance), generate an SSH key pair for use by the new user, as shown in the following example. When you are prompted for a file name, enter a file name of your choice. When you are prompted for a passphrase, press Enter to proceed without a passphrase.
    $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/joe/.ssh/id_rsa): /home/joe/.ssh/myadmin Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/joe/.ssh/myadmin. Your public key has been saved in /home/joe/.ssh/myadmin.pub. The key fingerprint is: e1:e0:f7:31:83:96:a5:8d:f6:f7:9c:1d:cb:2d:3e:7f joe@abc01234 The key's randomart image is: +--[ RSA 2048]----+ | | | | | . . . | | . o O | | . S = | | + o + | | o . . | | . o+oE| | .=*=| +-----------------+
    $ cat /home/joe/.ssh/myadmin.pub ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuOb4NO1l6QckeVgk/8ZdJc8UkfYYK/8CiAewxZdMRkuTMmjmmgr21ulRd4MompURb+Xw/cVOlK2eaBJRL9TXzG2Mf5gj8lyeve2GoIhiFXrV6bU9DlVSrf+y3BqNMixsF1/aSizP2PHmnECZyWdIKi5KdvNtyVE6f5Ul/286yJf3LCNP+bKLHv6uL8KwhArlz8cfv1OGYpzVW6e7Ja824RdHRTXOuh7JAR/1tGtd9lbZW/qqClyJlSbWVOh46l/2DdqoWQx6L7qzW3AzWVnTniFY4T8W06qT9pNbE08ygyCPVRfu8ZlBmRihFYRxdX4wm1P5qWj7RVhfmpq/AFrEyQ== joe@abc01234

    Creating a User and Enabling SSH Access for the User

    1. Use ssh to connect as the opc user to the Compute Classic instance on which you want to create a new user. In the ssh command, use the -i option to provide the private key that corresponds to the public key that you specified while creating the Compute Classic instance. Example:
    $ ssh -i ~/.ssh/occs opc@203.0.113.5

    If this is the first time you’re logging in to the instance, a message similar to the following is displayed:

    The authenticity of host '203.0.113.5 (203.0.113.5)' can't be established. RSA key fingerprint is 95:65:90:6f:10:0d:ff:d8:f1:cb:d0:21:d3:30:2e:b3. Are you sure you want to continue connecting (yes/no)?
    Warning: Permanently added '203.0.113.5' (RSA) to the list of known hosts. Authorized uses only. All activity may be monitored and reported.
    [opc@joedb ~]$ sudo su
    [root@joedb opc]# useradd myadmin
    [root@joedb opc]# mkdir /home/myadmin/.ssh
    [root@joedb opc]# echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0ibAEmysI4o1zfb4dOJIyaN67pya8AnOozVewilpv560jiagTzwrPG8bmK4GL3KEUc3lxZ/Xhj7RvdOD0qMAx0fFB3r80ZSy1KlkIXwKumUY+YBMyn1xdMluWS/J4JWKBpuoOMNTGy7QdCPIHrt07OnwSxvZsoyTsh9QZ/eJv4qR0YaFkAHyH9Si2hTC/6G6CZdXkw93LyEtW1ykxxkSJB6JYwB8FsBMcXPvYJ5CiR30fKqo6GP+WTz1xbTbahLLO31mx/qSDntcXEYgfpw7Abi8W6LSkExFOxrsKir8QqZregznVeWPiht9kf4PT9C3WOoDzA0aF1q+g1CJ1EhZow== joe@abc01234" > /home/myadmin/.ssh/authorized_keys
    [root@joedb opc]# cat /home/myadmin/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0ibAEmysI4o1zfb4dOJIyaN67pya8AnOozVewilpv560jiagTzwrPG8bmK4GL3KEUc3lxZ/Xhj7RvdOD0qMAx0fFB3r80ZSy1KlkIXwKumUY+YBMyn1xdMluWS/J4JWKBpuoOMNTGy7QdCPIHrt07OnwSxvZsoyTsh9QZ/eJv4qR0YaFkAHyH9Si2hTC/6G6CZdXkw93LyEtW1ykxxkSJB6JYwB8FsBMcXPvYJ5CiR30fKqo6GP+WTz1xbTbahLLO31mx/qSDntcXEYgfpw7Abi8W6LSkExFOxrsKir8QqZregznVeWPiht9kf4PT9C3WOoDzA0aF1q+g1CJ1EhZow== joe@abc01234
    AllowUsers oracle opc myadmin
    [root@joedb opc]# chown -R myadmin:myadmin /home/myadmin/.ssh 
    [root@joedb opc]# /sbin/service sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ]

    Enabling sudo Privileges for the New User

    1. To enable sudo privileges for the new user, edit the /etc/sudoers file by using the visudo command:

    Note: This step must be done by the root user or by any other user who has sudo privileges. On instances creating using Oracle-provided Oracle Linux images, the opc user has sudo privileges. In /etc/sudoers , look for the following line:

    %myadmin ALL=(ALL) NOPASSWD: ALL

    You can now use ssh to log in to the Compute Classic instance as the myadmin user, by using the private key that you generated in step 1 of Generating an SSH Key Pair.

    $ ssh -i /path/to/private/key myadmin@203.0.113.5 Authorized uses only. All activity may be monitored and reported. [myadmin@joedb ~]$

    Note: When a Compute Classic instance that is set up to boot from a nonpersistent boot disk is stopped and re-created, any OS-level changes you’ve made, including user creation, are lost.

    Want to Learn More?

    • Reserving a Public IP Address in Using Oracle Cloud Infrastructure Compute Classic
    • Attaching an IP Reservation to an Instance in Using Oracle Cloud Infrastructure Compute Classic
    • Creating a Bootable Storage Volume in Using Oracle Cloud Infrastructure Compute Classic

    Credits

    • Lead Curriculum Developer: Kumar Dhanagopal
    • Other Contributors: Octave Orgeron, Vimal Patel, Anamika Mukherjee

    Источник

    Читайте также:  Перенести кэш firefox linux
Оцените статью
Adblock
detector