Code Monkey home page Code Monkey logo

ytl's Introduction

YTL

https://www.youtube.com/watch?v=S1a7RmqeZ5E

https://www.youtube.com/watch?v=COp6JtP45o8

https://www.youtube.com/results?search_query=how+ssh+normal+user+on+linux

Here are the steps to create a non-root user who can SSH into an AWS Ubuntu VM from a local machine using another key:

Log in to the AWS Ubuntu VM as the root user.

Create a new user with the desired username using the following command:

php Copy code sudo adduser Replace with the desired username for the new user.

Set a password for the new user using the following command:

php Copy code sudo passwd Replace with the username you created in step 2.

Switch to the new user using the following command:

php Copy code su - Replace with the username you created in step 2.

Generate a new SSH key pair on the local machine using the following command:

Copy code ssh-keygen -t rsa Follow the prompts to save the key pair to the desired location.

Copy the public key to the AWS Ubuntu VM using the following command:

vbnet Copy code ssh-copy-id -i /path/to/public/key @ Replace /path/to/public/key with the path to the public key file you generated in step 5, with the username you created in step 2, and with the IP address of the AWS Ubuntu VM.

Test the SSH connection from the local machine using the following command:

vbnet Copy code ssh -i /path/to/private/key @ Replace /path/to/private/key with the path to the private key file you generated in step 5, with the username you created in step 2, and with the IP address of the AWS Ubuntu VM.

Optionally, you can configure the SSH server on the AWS Ubuntu VM to disable root login and password authentication, and only allow SSH access using public key authentication. To do this, edit the /etc/ssh/sshd_config file and set the following options:

yaml Copy code PermitRootLogin no PasswordAuthentication no ChallengeResponseAuthentication no UsePAM no PubkeyAuthentication yes Save the file and restart the SSH server using the following command:

Copy code sudo systemctl restart sshd This will increase the security of your SSH access to the AWS Ubuntu VM.

ytl's People

Contributors

sabirk8992 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.