Tag Archives: bash

Passwd: authentication token manipulation error in Linux

If in Linux, whether root or ordinary user logs in and changes their password, passwd: Authenticationtoken Manipulation error occurs — the solution to the error:
Root herself failed to change the password

Normal user failed to change password

1. Reporting such an error is: password: authentication token operation error, usually due to the permissions of the password file, but may also be the root directory space is full.

Using the Lsattr command to view the file properties that hold the user and password, you find the I option: (I: Do not arbitrarily change files or directories.) As a result, all users cannot change their passwords because they have no permission to do so.
2. We need to use the chattr command to revoke the I permission, and then modify, it is ok.

3. Then test root and Xiaogang users to change their passwords.
Test the root user to change the password

Test xiaogang users to change their passwords

4. For security reasons, it is better to change the password and protect the file where the user and password are stored.
Also chattr + I /etc/passwd and chattr + I /etc/shadow files
5 ordinary users to modify their passwords, is required, the password must be complex, and in the password dictionary some characters can be set.

[Fixed] Syntax error: word unexpected (expecting “)”)

mkdir.sh

Execute sh mkdir.sh XXX (argument)

Error: mkdirs.sh: 9: Syntax error: Word unexpected (“do”)
Syntax error: word unexpected (“)”)
Similar problems, the case see details
http://ubuntuforums.org/archive/index.php/t-1130892.html
http://forum.ubuntu.org.cn/viewtopic.php?f=21& t=416571

Summarize several questions:
1. dos2unix xxx
2. Sh mkdir.sh failed to run mkdir.sh directly
3. Modify the #!/bin/sh to #! /bin/bash, then execute bash mkdir.sh XXX
4. See if there are any errors in the syntax, if line wrapping is required; Etc.
5. For permission issues, try to implement a copy of cp
Ls-l look at the owner