How to Add/Remove FTP users in Linux and set permissions (follow-up) __linux

Source: Internet
Author: User
Tags chmod

In the article "How to Add/Remove FTP users and set permissions in Linux", we talked about how to add and remove users, but later, we still encountered a lot of

Problem:

1. After entering the system, the command line has only a dollar sign such as "$", and the environment variable file is already copied to the user's home directory, how to revert to the xxx@ host name: ~$

Such a format.

vim/etc/passwd

See your own user name, such as:

TEST:X: ():()::/home/test:

Add/bin/bash to the back and you'll be fine.
That
TEST:X: ():()::/home/test:/bin/bash

If the "/etc/passwd" E212:can ' t open file for writing appears, there is a problem with the permissions, and after exiting, the Chattr-i/etc/passwd is executed and can be changed.

2. Unable to use root permissions

test@iz28m0c0sk6z:~$ sudo-i
[sudo] password for test: The ' isn't in ' 
sudoers file.  This incident would be reported.

(1) Add Write permission to the sudo file, the command is:

chmod u+w/etc/sudoers

(2) Edit sudoers file
Vim/etc/sudoers

Find this line
Root all= (All:all) all

Add below it:

XXX all= (all:all) all #这里的xxx是你的用户名

PS: Here you can sudoers add any of the following four lines.
Youuser            all= (All)                all
%youuser           all=-                all Youuser all=
%youuser           All= (All)                Nopasswd:all

First line: Allows the user to Youuser execute the sudo command (requires a password).
Second line: Allows users in the user group Youuser to execute sudo commands (require a password).
Third line: Allows the user to execute the sudo command youuser, and does not enter the password at execution time.
Line four: Allows the user group Youuser users to execute sudo commands and not enter the password at execution time.

(3) Revoke sudoers file Write permission, command:
chmod u-w/etc/sudoers

This allows the average user to use sudo.

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.