zoukankan      html  css  js  c++  java
  • Enable root Access for Linux Instances

    AWS doesn't grant root access by default to EC2 instances. This is an important security best practise. Users are supposed to open a ssh connection using the secure key/pair to login as ec2-user. Users are supposed to use the sudo command as ec2-user to obtain elevated privileges.

    Problems arise with a number of software packages which require remote root access for installation and operation. The following cheat sheet explains how to enable root access. It hasn't been tested with all Linux distributions.

    Disclaimer: Enabling direct root access to EC2 systems is a bad security practise which AWS doesn't recommend. It creates vulnerabilities especially for systems which are facing the Internet (see AWS documentation).

    Use these commands on your own risk. Understand the function of the commands and the related risks before you apply them.

    All commands require root privileges which can be obtained through the sudo command.

    Create a root Password

    $ passwd root <the password>

    Configure and Restart the ssh Service for root Access

    Edit the configuration file /etc/ssh/sshd_config. Change the following to parameter to the values shown below:

    PermitRootLogin yes
    PasswordAuthentication yes

    Restart the service with the command

    $ service sshd reload

    Patch the authorized Keys File for the root User

    The simplest way is to use the ec2-user file and the certificate for the root user. Copy the ec2-user file over to the root user:

    $ cp ~ec2-user/.ssh/authorized_keys ~root/.ssh/authorized_keys

    This allows as well to login with the same key which is available for the ec2-user.

    Update the AWS Cloud Configuration File

    Edit the file /etc/cloud/cloud.cfg and change the following entry to this value:

    disable_root false
  • 相关阅读:
    Vue开源项目库汇总【壮灬哥出品,必为精品】
    nginx配置
    找出判断数据是否有相同的值
    CSS设置文字不能被选中
    js怎么删数组固定的值
    IO流中File文件最常用和直接的用法
    JComboBox实现当前所选项功能和JFrame窗口释放资源的dispose()方法
    java中经常使用的Swing组件总结
    JTextArea利用JScrollpane增加文本域滚轮(滚动条)
    JFrame关闭程序就退出的设置
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/15512428.html
Copyright © 2011-2022 走看看