What's new
  • Welcome to PHCorner forums. Take a moment to sign up and gain unlimited access and extra privileges that guests are not entitled to, such as: All that and more! Registration is quick, simple and absolutely free. Join our community today!

Tutorial Enable root login with password of AWS EC2/Lightsail Instance

phc-exert

Elite
Joined
Jan 12, 2017
Messages
4,113
Solutions
2
Reaction
11,597
1. In terminal, first run
Code:
sudo su -

2. Then edit sshd config
Code:
nano /etc/ssh/sshd_config

3. Find these lines

#PermitRootLogin prohibit-password
PasswordAuthentication no

Change them respectively to these

PermitRootLogin yes
PasswordAuthentication yes

note: uncomment or remove the "#" character

Ctrl+X then Y then Enter to exit

4. Then restart sshd
Code:
systemctl restart sshd

5. Set password for root
Code:
passwd root

Enter your desired password
note: no characters will appear on the screen as you type, just proceed

To disable PEM/PPK login, repeat Step 2

Then find this line

#PubkeyAuthentication yes

Change to

PubkeyAuthentication no

Ctrl+X then Y then Enter to exit

Then restart sshd, repeat Step 4


Then logout and try to login as root
 
Last edited:

prosper

Established
Use Putty for PC
I've successfully login to my account using juicessh but now I need to create root password that I can use on my kpn on the server
 
1 Comment
P
phc-exert

prosper

Established
1 Comment
P
phc-exert
Okay just follow the steps above carefully
 

prosper

Established
Can you please login to my pc to sort it out for me. Cause I'm still getting same problem
 

Attachments

1 Comment
P
phc-exert
Here's my advice
Since you've already logged in to juicessh successfully, then just use juicessh to run the steps above.
Just follow them carefully, because errors might cause you to be locked out of your instance.
 

prosper

Established
Convert first your pem file to ppk file

Frist run Puttygen (Putty Key Generator)
Click Load

View attachment 1125898

Click on this and choose All files

View attachment 1125901

Then find your pem file, then click open



Then Save private key

View attachment 1125903



Run Putty then in Connection > SSH > Auth, click on browse, then find your ppk file

View attachment 1125919

In Connection copy this settings (this is only to prevent your session from disconnecting)
View attachment 1125927

Go back to Session, then input your server's IP address here, then click Open

View attachment 1125931
Can we use bitvise
Here's my advice
Since you've already logged in to juicessh successfully, then just use juicessh to run the steps above.
Just follow them carefully, because errors might cause you to be locked out of your instance.
Can we maybe use bitvise please putty and juice ssh it's bit complicated for me lol
 
1 Comment
P
phc-exert
I haven't used bitvise, but i'll try maybe later or tomorrow
 

Online statistics

Members online
1,762
Guests online
2,209
Total visitors
3,971

Forum statistics

Threads
1,012,369
Messages
17,357,768
Members
1,485,592
Comments
677,814
Attachments
1,135,761
Profile posts
96,441
Top