Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I am new to Amazon AWS and trying to figure out how I can manage my server. I have installed CentOS 6 64 bit and trying to find out a way to login as root via SSH. I have created a key pair and downloaded it but I am not sure what else I can do from there.

Any ideas on how to get SSH access to my server (what programs to use) and how I can enable root? I currently have Putty, PuttyGen and WINSCP to use.

share|improve this question
Logging it with root via SSH is "Doing it Wrong". There is, quite simply, no good reason why you should need to do this. Tell us your use case here and we'll see if there's a better and more secure way you can accomplish it. – EEAA Oct 14 '13 at 21:25
I've only known how to login and use this user. What user would I login with instead of root for the EC2? I also need to install cPanel as root too:… – user1804933 Oct 14 '13 at 21:28

You'll need to ensure that 'PermitRootLogin' is set to yes in your /etc/ssh/sshd_config file to allow remote root logins. I would strongly discourage this however, as it is exremely bad practice, and highly insecure to allow remote root logins.

When you are logged in as a normal user, you can use the 'sudo' command to temporarily elevate yourself to root privileges on a per command basis, or even run 'sudo su -' to run a root shell. The sudo command is configured in the /etc/sudoers file. I recommend reading this link for further information on sudo and how to configure it:

share|improve this answer

Sounds like you already have SSH access to your server, you're just familiar with account-based login and not certificate-based.

  1. Take the PEM file that you downloaded, run it through Puttygen to export a ppk file (with SSH2-RSA selected)...detailed instructions are here:

  2. then open Putty. In the hostname box (assuming you did the Amazon Linux image), enter:


(where the XXX's are your instances public IP address)

  1. On the menu on the left, go to Connection, SSH, Auth, there'll be a box that says Private Key File for Authentication; enter the full path & name for the PPK file you created in step one, then click Open.

  2. Profit.

To run elevated commands, use sudo as mentioned in the prior answer....but Amazon's default builds don't start you off with account-based login for most Linux instance types.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.