Modify the. profile file of a non-current account in ubuntu

Source: Internet
Author: User

Non-local account in ubuntu. the profile file was accidentally modified in the account today. profile file, so that the account cannot enter after the restart, click the account to log on to the black screen, and then return to the Account Login page again. After some tossing, I finally successfully modified the. profile file in the original account and successfully re-entered the original account. My initial thought was to create a new Administrator Account and modify the one under the original Administrator account in the new account. profile file. After being created, it is found that ubuntu still has good account control. Even if you have the password of the original account, you cannot escalate the permissions of the new account to the height where the original account file can be modified. Therefore, this pattern is used instead, but many details are described, mainly to provide ideas for everyone. The modification process is as follows: first create an administrator account and enter. Enter the directory home/original account in the terminal. Run the vi command to edit the. profile file. Log on to the original account again. Command: in the terminal, cd/home/my (my is my original account name) sudo vi. commands that may be used in profile vi: insert text commands (esc exits Upon insertion) I: Before the cursor I: at the beginning of the current line a: After the cursor: at the end of the current Row o: open a new line under the current Row O: open a new line above the current row r: Replace the current character R: Replace the current character and the character behind it, until Press ESC key s: Starting from the current cursor position, replace the specified number of characters with the input text S: Delete the specified number of rows, replace "ncw" or "nCW" with the entered text: modify the number of nCC words: modify the number of lines to delete the command ndw or ndW: delete the n-1 words "do" at the beginning and after the cursor: Delete to the beginning of the line d $: Delete to the end of the line ndd: Delete the current line and the next n-1 lines x or X: delete a character, x deletes the cursor, while X deletes the Ctrl + u before the cursor: deletes the input text in the input mode to save and exit the command (note ":" cannot be omitted): w: save the current file: x: Save the current file and exit: q: Exit vi: q!: Do not save the file and exit vi MODIFICATION. Save and exit. Then, log on to the original account again. If the vi command is not enough, you can use Baidu. If you do not understand the. profile content, you can refer to the. profile file content modification under the new account. In addition, if you do not create an account, you must select the root mode (the title is root) in the repair option. The command is the same. Finally, we strongly recommend that you try it out. you can create a new management account, set the management account to read and write permissions in the original account, and directly log on to the management account to modify the profile file. save the profile file.

Related Article

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.