Change the root password and log in with the root account password

Source: Internet
Author: User
Tags ssh

Install Ubuntu system to machine, Admin account is set up, change root password and login with root account password


Change root password:

Check some information on the Internet change the root password, and user name and user password.

Modify root password: sudo passwd root

Modify host Name: sudo vi/etc/hostname change the name to its own name

sudo vi/etc/hosts changed the name to his name.

Modify user name: sudo vi/etc/passwd find the original username, change it to its own user name, but/home/"original username" in the can not change, if the change restart, then landing system.

sudo vi/etc/shadow find the original username and change to its own username

When the above steps are complete, sudo reboot reboots

After restarting, into the system, found in the home directory user directory or the original user name, but with the command ls-al can see the user directory of users have changed to your own users, the following "MV User directory name of their own user directory name" will be changed under the directory name. For example, the original directory name xxxx is now to be changed to user yyyy. With the command MV XXXX YYYY can be.



Login with Root account password: (excerpt from Baidu Experience)

Problem phenomenon:

1. Use Xshell to access Ubuntu Server, unable to connect




2. Install SSH without service on Ubuntu server. sudo apt-get install openssh-server Xshell tests non-root users and can connect normally, but root users still cannot access






Workaround:

1. Modify the/etc/ssh/sshd_config file, add the Permitrootlogin Prohibit-password # comment out

New add: Permitrootlogin yes2. Reboot SSH service/etc/init.d/ssh restart;

3. Re-use root connection, OK.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.