EC2 Linux SSH Authentication.
By default, preferred and default way of accessing any ec2 linux instance is key based authentication.Here in this blog post, we will know - How to enable basic authentication that is password based authentication in ec2 instance.
- How to enable root login to ec2 instance.
I will keep on updating the post as per my learnings and used in practical scenarios.
Let's go through it :)
How to enable root login on linux ec2 instance.- Login to ec2 linux instance using it's private key.
- Sudo to root
- change password for root
- Permit root login in sshd_config file
By default, preferred and default way of accessing any ec2 linux instance is key based authentication.
Here in this blog post, we will know
- How to enable basic authentication that is password based authentication in ec2 instance.
- How to enable root login to ec2 instance.
I will keep on updating the post as per my learnings and used in practical scenarios.
Let's go through it :)
- Login to ec2 linux instance using it's private key.
- Sudo to root
- change password for root
- Permit root login in sshd_config file
Syntax
[ec2-user@ip-10-0-1-116 ~]$ sudo su
[ec2-user@ip-10-0-1-116 ~]$ sudo su
Change root password from below command.
[root@ip-10-0-1-116 ec2-user]# passwd root
[root@ip-10-0-1-116 ec2-user]# passwd root
Permit root login by un-commenting the below line in sshd_config
[root@ip-10-0-1-116 ec2-user]# vi /etc/ssh/sshd_config
[root@ip-10-0-1-116 ec2-user]# vi /etc/ssh/sshd_config
From
# PermitRootLogin yes
# PermitRootLogin yes
To
PermitRootLogin yes
PermitRootLogin yes
How to enable password based authentication for ssh user.- Login to ec2 linux instance using it's private key.
- Sudo to root
- Permit root login in sshd_config file
- Restart sshd service
- Login to ec2 linux instance using it's private key.
- Sudo to root
- Permit root login in sshd_config file
- Restart sshd service
Syntax
[ec2-user@ip-10-0-1-116 ~]$ sudo su
[ec2-user@ip-10-0-1-116 ~]$ sudo su
Permit root login by un-commenting the below line in sshd_config
[root@ip-10-0-1-116 ec2-user]# vi /etc/ssh/sshd_config
[root@ip-10-0-1-116 ec2-user]# vi /etc/ssh/sshd_config
From
# PasswordAuthentication yes
# PasswordAuthentication yes
To
PasswordAuthentication yes
PasswordAuthentication yes
Restart SSHD service
service sshd restart
service sshd restart
Login and check !
No comments:
Post a Comment