开发者

ssh root into ec2

I have an Amazon ec2 instance running, and I have a non-root user set up that I use to ssh.

I have both the private key and certificate stored on my ~. This is the command that I'm using to try and log in, but it prompts me for a password (which I don't know/have).

$ sudo ssh -i mykey.pem root@ec2-amazoninstance.com
root@ec2-amazoninstance.co开发者_C百科m's password: 
Permission denied, please try again.

How do I log into root not knowing this password?


On linux, once logged in as a user you use the command su to become root.

To directly login into the root account you need to make sure

  • that you own the correct key or know the password
  • root login is enabled in the SSH server

On a linux machine you would then run ssh root@ip to login as root on ip.


If the current user is a normal user then use "sudo su" command to become root user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜