Answer the question
In order to leave comments, you need to log in
Amazon EC2 ssh authorization (publickey)
A bit confused with authorization on Amazon EC2.
There is an instance with debian, authorization by key for root works fine.
It is necessary to make authorization for other users.
I create a new Key Pair in the Amazon Management Console , I get a file named .pem
What's next? how to bind this key to a specific debian user?
Answer the question
In order to leave comments, you need to log in
This pair of keys is needed so that during installation of the system you can perform a root login and continue to manage the server. Use the guide that I wrote on the example of how to create a key for a user (I wrote for red-hat, it should be the same in debian)
1) We go to the server as root and add a user and generate keys for him, enter user1 in the name of the key (below)
adduser user1
cd /root/
ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): user1
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): <press ENTER for no password>
Enter same passphrase again: <press ENTER for no password>
Your identification has been saved in /root/.ssh/user1.
Your public key has been saved in /root/.ssh/user1.pub.
mkdir /home/user1/.ssh
cp user1.pub /home/user1/.ssh/authorized_keys
chown user1:user1 /home/user1/.ssh/authorized_keys
mv user1 user1.pem
ssh -i user1.pem [email protected] without entering a password
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question