Today began to study the Amazon Cloud host EC2, encountered a problem, I need to install Tomcat on EC2, but the Yum command can only be root user to run, and EC2 default is to Ec2-user user login, so need to switch to the root user login, The results of the study are published as follows:
1, according to the method provided by the official website login to connect to the EC2 server (website recommended for Windows users to use Putty connection)
2, create the root password, enter the following command:
sudo passwd root
3. You will then be prompted to enter new password. Enter a password for the root you want to set, and you need to enter it again for verification.
4, Next, switch to root identity, enter the following command:
Su Root
5, use the root identity to edit the Amazon Cloud host SSH login method, find Passwordauthentication No, change no to Yes. Input:
Vim/etc/ssh/sshd_config
6, Next, to restart the next sshd, such as the following command:
Sudo/sbin/service sshd Restart
7, then switch to root identity
Su Root
8. Add the login password for the original "Ec2-user". As the following command:
passwd Ec2-user
Follow the prompts and enter your password two times. To this, you can log in to EC2 server directly as root.
======== still have a lot of basic commands to use, like vim.
I. So how to install vim?
Enter the Rpm-qa|grep vim command, and if Vim is properly installed, it will return the following three lines of code:
[email protected] [~]
# rpm -qa|grep vim
vim-enhanced-7.0.109-7.el5
vim-minimal-7.0.109-7.el5
vim-common-7.0.109-7.el5
If one of the strips is missing, such as vim-enhanced, use the command yum-y install vim-enhanced Laian:
yum -y
install
vim-enhanced
If none of the above three strips is returned, you can use the Yum-y install vim* command directly
yum -y
install
vim*
Create the root user on EC2 and log in with the root user