Tag Archives: linux

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.

Failed to create VirtualBox client com

Normal shutdown of VirtualBox a few days ago, today found unable to boot my system when OS X 10.10. This may be the result of the recent frequent VirtualBox upgrades.

Advice:
Provide a snapshot of the Linux virtual machine that is normally performing major configuration or project work

Error message:
VirtualBox client COM failed to create
Caller RC: NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154)

Try solutions:
Restart the computer;
Reinstall VirtualBox
Correct solution:
Access to the Internet caused by access problems.
Find my VirtualBox application is in/usr/local/bin/VirtualBox
Open the terminal operation failure directly, use sudo/usr/local/bin/VirtualBox can run. But this is inconvenient. You have to run from Terminal as root every time.
Find the solution on the VirtualBox website below:
The first step:
View permission information for/TMP directory:

/bin/ls -ld /tmp

The second step:

Sets the owner of the/TMP directory to root

chown root /tmp

Third part:

Change the access control permissions of the file owner and group, -s is to give suID permissions, ordinary users can also run as root permissions.

chmod ug-s /tmp

Step 4:

Grant permission to the/TMP directory RWX 777

chmod 1777 /tmp

Step 5:

Delete the old.vbox directory

rm -fr /tmp/.vbox-root-ipc/

Then start VirtualBox!

Linux getsockopt SO_ERROR values (errno.h)

The C function getsockopt lets you get the error codes with the option SO_ERROR.
The possible error numbers are defined in the global errno.h. The relevant values are:

#define ETIMEDOUT   110 /* Connection timed out */
#define ECONNREFUSED    111 /* Connection refused */
#define EHOSTDOWN   112 /* Host is down */
#define EHOSTUNREACH    113 /* No route to host */
#define EALREADY    114 /* Operation already in progress */
#define EINPROGRESS 115 /* Operation now in progress */



//But here's the whole list on my Linux system (/usr/include/asm-generic/errno.h):

#ifndef _ASM_GENERIC_ERRNO_H
#define _ASM_GENERIC_ERRNO_H

#include <asm-generic/errno-base.h>

#define EDEADLK     35  /* Resource deadlock would occur */
#define ENAMETOOLONG    36  /* File name too long */
#define ENOLCK      37  /* No record locks available */
#define ENOSYS      38  /* Function not implemented */
#define ENOTEMPTY   39  /* Directory not empty */
#define ELOOP       40  /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN  /* Operation would block */
#define ENOMSG      42  /* No message of desired type */
#define EIDRM       43  /* Identifier removed */
#define ECHRNG      44  /* Channel number out of range */
#define EL2NSYNC    45  /* Level 2 not synchronized */
#define EL3HLT      46  /* Level 3 halted */
#define EL3RST      47  /* Level 3 reset */
#define ELNRNG      48  /* Link number out of range */
#define EUNATCH     49  /* Protocol driver not attached */
#define ENOCSI      50  /* No CSI structure available */
#define EL2HLT      51  /* Level 2 halted */
#define EBADE       52  /* Invalid exchange */
#define EBADR       53  /* Invalid request descriptor */
#define EXFULL      54  /* Exchange full */
#define ENOANO      55  /* No anode */
#define EBADRQC     56  /* Invalid request code */
#define EBADSLT     57  /* Invalid slot */

#define EDEADLOCK   EDEADLK

#define EBFONT      59  /* Bad font file format */
#define ENOSTR      60  /* Device not a stream */
#define ENODATA     61  /* No data available */
#define ETIME       62  /* Timer expired */
#define ENOSR       63  /* Out of streams resources */
#define ENONET      64  /* Machine is not on the network */
#define ENOPKG      65  /* Package not installed */
#define EREMOTE     66  /* Object is remote */
#define ENOLINK     67  /* Link has been severed */
#define EADV        68  /* Advertise error */
#define ESRMNT      69  /* Srmount error */
#define ECOMM       70  /* Communication error on send */
#define EPROTO      71  /* Protocol error */
#define EMULTIHOP   72  /* Multihop attempted */
#define EDOTDOT     73  /* RFS specific error */
#define EBADMSG     74  /* Not a data message */
#define EOVERFLOW   75  /* Value too large for defined data type */
#define ENOTUNIQ    76  /* Name not unique on network */
#define EBADFD      77  /* File descriptor in bad state */
#define EREMCHG     78  /* Remote address changed */
#define ELIBACC     79  /* Can not access a needed shared library */
#define ELIBBAD     80  /* Accessing a corrupted shared library */
#define ELIBSCN     81  /* .lib section in a.out corrupted */
#define ELIBMAX     82  /* Attempting to link in too many shared libraries */
#define ELIBEXEC    83  /* Cannot exec a shared library directly */
#define EILSEQ      84  /* Illegal byte sequence */
#define ERESTART    85  /* Interrupted system call should be restarted */
#define ESTRPIPE    86  /* Streams pipe error */
#define EUSERS      87  /* Too many users */
#define ENOTSOCK    88  /* Socket operation on non-socket */
#define EDESTADDRREQ    89  /* Destination address required */
#define EMSGSIZE    90  /* Message too long */
#define EPROTOTYPE  91  /* Protocol wrong type for socket */
#define ENOPROTOOPT 92  /* Protocol not available */
#define EPROTONOSUPPORT 93  /* Protocol not supported */
#define ESOCKTNOSUPPORT 94  /* Socket type not supported */
#define EOPNOTSUPP  95  /* Operation not supported on transport endpoint */
#define EPFNOSUPPORT    96  /* Protocol family not supported */
#define EAFNOSUPPORT    97  /* Address family not supported by protocol */
#define EADDRINUSE  98  /* Address already in use */
#define EADDRNOTAVAIL   99  /* Cannot assign requested address */
#define ENETDOWN    100 /* Network is down */
#define ENETUNREACH 101 /* Network is unreachable */
#define ENETRESET   102 /* Network dropped connection because of reset */
#define ECONNABORTED    103 /* Software caused connection abort */
#define ECONNRESET  104 /* Connection reset by peer */
#define ENOBUFS     105 /* No buffer space available */
#define EISCONN     106 /* Transport endpoint is already connected */
#define ENOTCONN    107 /* Transport endpoint is not connected */
#define ESHUTDOWN   108 /* Cannot send after transport endpoint shutdown */
#define ETOOMANYREFS    109 /* Too many references: cannot splice */
#define ETIMEDOUT   110 /* Connection timed out */
#define ECONNREFUSED    111 /* Connection refused */
#define EHOSTDOWN   112 /* Host is down */
#define EHOSTUNREACH    113 /* No route to host */
#define EALREADY    114 /* Operation already in progress */
#define EINPROGRESS 115 /* Operation now in progress */
#define ESTALE      116 /* Stale NFS file handle */
#define EUCLEAN     117 /* Structure needs cleaning */
#define ENOTNAM     118 /* Not a XENIX named type file */
#define ENAVAIL     119 /* No XENIX semaphores available */
#define EISNAM      120 /* Is a named type file */
#define EREMOTEIO   121 /* Remote I/O error */
#define EDQUOT      122 /* Quota exceeded */

#define ENOMEDIUM   123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
#define ECANCELED   125 /* Operation Canceled */
#define ENOKEY      126 /* Required key not available */
#define EKEYEXPIRED 127 /* Key has expired */
#define EKEYREVOKED 128 /* Key has been revoked */
#define EKEYREJECTED    129 /* Key was rejected by service */

/* for robust mutexes */
#define EOWNERDEAD  130 /* Owner died */
#define ENOTRECOVERABLE 131 /* State not recoverable */

#define ERFKILL     132 /* Operation not possible due to RF-kill */

#define EHWPOISON   133 /* Memory page has hardware error */

#endif

Source: http://www.xinotes.net/notes/note/1793/

There is a solution to the problem: severity = corrected, type = physical layer, id = 00e5 or id = 00e8 (receiver ID) under Ubuntu

I press CTR + Alt +F1 or F2 on Ubuntu and the screen flashes repeatedly as follows:
PCIe Bus Error: severity=Corrected, type=Physical Layer, id=00e8(Receiver ID)
As the search on the Internet, I found only: https://blog.csdn.net/qimengxingyuan/article/details/80874314?utm_source=blogxgwz2
His id=00e5 is different from mine, but I can’t find it. Follow the instructions:
——————— 
Specific operation
Edit the grub
Sudo gedit – H/etc/default/grub
Add boot option
Find GRUB_CMDLINE_LINUX_DEFAULT = “quiet splash.” ”
Add behind pci = nomsi pci = noaer pcie_aspm = off
— — — — — — — — — — — — — — — — — — — — —
I am in GRUB_CMDLINE_LINUX_DEFAULT = “quiet splash” added after the concrete is:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” pci=nomsi pci=noaer pcie_aspm=off
I tried it and it still didn’t work, And I thought I made a mistake and I tried it a couple of times and it still didn’t work, and finally I saw this
https://askubuntu.com/questions/863150/pcie-bus-error-severity-corrected-type-physical-layer-id-00e5receiver-id
Oh, I finally found it. It was my wrong way to modify it. The correct modification is as follows:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash pci=nomsi pci=noaer pcie_aspm=off
Then, as described in the two blogs above, perform:
1. Save the modification and exit
2, execute sudo update-grub
The 3, reboot
is now complete.
thanks for the above two detailed records
 
 

Nginx error log (error_ Log) configuration and information explanation

Nginx error log (error_log) configuration and information detail
Nginx software will record the fault information of its own operation and log information of user access to the specified log file.
Nginx error log information is introduced
Nginx error message is an important means of debugging Nginx service, belongs to the core function module (NGX_core_module) parameter, the name of the parameter is error_log, can be placed in the Main block global configuration, can also be placed in a different virtual host to separate the virtual host error message
The default value of error_log:

# error_log logs/error log the error;

The syntax format and parameter syntax of error_log are described as follows:

Error_log & lt; FILE> & lt; LEVEL>;
Keyword log file error log level
 
Keyword: Where the keyword error_log cannot be changed
Log file: You can specify any directory where you want to store logs
Error log level: the common error log level is [debug | info | notice | warn | error | crit | alert | emerg], the higher the level is, the less information will be recorded.
The production scenario is generally one of the three levels of warn | error | crit

Note: Do not configure the lower levels of the INFO level, which can cause significant disk I/O consumption.
The tag segment location of the error_log parameter:

main, http, server, location

Reference data: http://nginx.org/en/docs/ngx_core_module.html#error_log
The Nginx configuration error logging procedure is described
(1) Insert the error_log statement

vi conf/vhost/www.abc.com.conf
# VI edit the virtual host configuration file

Document Contents:

server {
Access_log/data/log/WWW.
Listen, 80;
Server_name abc.com www.abc.com;
The location/{
The root/data/WWW/WWW.
The index index. HTML index. HTM;
}
Error_log logs/error_www.abc.com.log error;
# New content ↑
}

(2) Restart the service
After confirmation, you can restart the machine. The operation is as follows:

nginx -t
# results show that OK and Success are ok and can be restarted
nginx -s reload

(3) Check the error log file

ll logs/error_www.abc.com.log
-rw-r–r– 1 root root 2305 Jun 13 18:25 logs/error_www.abc.com.log

Check to see if the file is produced and the configuration is successful.

putty Network error:Software caused Connection abort solution – measured valid

First of all, I from the Internet Baidu a lot of answers, tried a lot of times are useless, a chance, let me find a real solution in the post.
Not wordy ~

    local computer pull up the command line win+R enter the regedit go to the registry find HKEY_CURRENT_USER find the software HKEY_CURRENT_USER\ software \SimonTatham delete putty in there and download puttyperfect~~~

Can help friends to solve more to see ~~~

Error 403 Forbidden when using WGet or curl

This error occurred because the server rejected the request using wget or curl. In order to prevent crawlers from consuming the server resources, the server selectively screened the request headers according to your request. Therefore, the Agent user-agent of wget and curl needs to be modified for camouflage.
 
I. Modify user-Agent of WGET
1. Temporarily change THE UA of WGET
Before wget, add the parameter -u , which means to set User Agent

wget www.google.com -U "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"

What is User Agent and how to get it, please refer to the following blog. Of course, you can also use the above one directly.
What is the UserAgent and how to view the UserAgent using the browser
 
2. Permanently change THE UA of Wget
Modify the configuration file /etc/wgetrc to add the following line:

header = User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

The above configuration will take effect for all users. If you only want the current user to take effect, you can add the above line to ~/.wgetrc. If this file is not available, you can create it manually.
 
2. Modify the user-Agent of curl
1. Temporary change to Curl’s UA
Use the following parameters:

curl https://www.google.com --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"

 
2. Permanently change Curl’s UA
Modify the profile ~/.curlrc to add the following line:

–user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

 
Reference:
1, https://www.linpx.com/p/on-an-interesting-play-wget-use.html
2, https://chaifeng.com/_curl_wget_user-agent/

Win7 and Ubuntu dual system, start error: no such partition grub rescue

My laptop installed Windows 7 and Ubuntu dual system, due to company regulations, after installing sandbox software and modifying Win7 partition, I could not start Windows 7 and Ubuntu.
Here is the solution:
First, restore the Win7 system to start.
Use U disk to do a “old peach Winpe” to start disk, specific method see “old peach” official website.
enter winpe, start menu -> “Boot repair”, the window background color is green, select the system is located in the disk character, generally C disk, according to the prompt to operate.
Enter Win7 and restore Ubuntu disk boot.
Open the partition assistant and click “Free partition” to quickly restore boot. The “free partition” is restored to its original partition, such as an ext4 partition.
Restore and boot Ubuntu
1, make Ubuntu install usb flash drive, not Baidu. 2, set the BIOS from the U disk, select try ubunu, do not install.
3, enter the system open terminal
sudo add-apt-repository ppa:yannubuntu boot-repair & & Sudo apt-get update
then type sudo apt-get install-y boot-repair & & Boot-repair
and click the first note: repair
Then it will tell you: Close Boot Security, Retry, just click Yes, wait a few minutes and restart the Ubuntu Boot TAB.

“Permission denied” error in Oracle10g installation

Reason: Before the software was uploaded to the Linux server, it was unzipped and then uploaded in the Windows environment. When it was uploaded, it was already the folder after decompression, so the execution permission of those three files was lost.
Solutions:
1, enter database folder
2, chmod 755 runInstaller(grant permissions)
3, enter install LLL a(view files)
4, chmod 755. Oui (solve install/. Oui this hidden file does not have permissions to execute)
5, chmod 755 unzip(solve unzip permissions)
6, then execute in the Database folder./runInstaller

Error connecting to master, – retry time: 60 retries: 86400

Two virtual machines configured MySQL master slave when the virtual machine input
> show slave status\G;
Displays the following error
Last_IO_Error: error connecting to master ‘[email protected]:3307’ – Retry time: 60 Retry: 86400
I. Screening:
1. The username and password are correct
2. The port number of master is correct
3. Master authorization

# cat/data/mysql2/hostname. Err “to view the error log”

Slave I/O: ERROR connecting to master ‘[email protected]:3306’ – retry-time: 60 retry: 86400, Error_code: 2013
You don’t see anything. Error messages have no value.

Mysql – uslavelaowang – h192.168.32.133 – ppasswd
ERROR 2003 (HY000): Can’t connect to MySQL Server on ‘192.168.32.133’ (113)

# perror 113
OS Error code 113: No Route to host
【 Consider network reasons 】

# ping 192.168.32.133 [from the main ping] # Ping 192.168.32.132 [from the main ping] both have the return result, indicating network connection. Iptables -Fservice Iptables Save [Master Cleaning Firewall Rules]
Slave operation

# mysql – uslavelaowang h192.168.32.133 — ppasswd

ERROR 2003 (HY000): Can’t connect to MySQL Server on ‘192.168.32.133’ (111)

# perror 111
OS Error code 111: Connection union (union (union))
# mysql [Enter mysql under]
> slave stop;
> slave start;
> show slave status;
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Return two Yes’s

Reason: Iptalbes firewall rules are not cleared.

error: expected declaration or statement at end of input

This error is sometimes reported in Linux programming, and it hurts a lot because the compiler doesn’t tell you exactly what went wrong…
There are several possible reasons for this error:
1) Where the program is missing a parenthesis.
The detection method is as follows. If you are programming with VIM, you can use % to match the parentheses one by one. Here is how I did it
2) the variable does not declare

Solve cannot execute binary file: exec format error under Linux

For Linux, cannot execute Binary file: Exec Format error clearly indicates that it is an execution file format error.
1. Use the wrong command, such as GCC-c hello. c-o hello, and you get a.o file instead of an executable./hello will report the above error! Change to GCC hello. C-o Hello is ok!
2. If not the above error, it may be a version problem, such as the original 32 bit operating system, but the use of 64-bit software, at this time the need is to use the correct version of the software!

attached:
A solution to the problem that Cannot execute Binary File is encountered in Linux system,
From http://1381479.blog.51cto.com/1371479/888198

The problem that cannot execute Binary file is encountered in Linux system is generally caused by the following situations:

    1. 1.non-root user or non-execute permission
      1. 2.compilation environment is different (the program is copied from ot

    her operating environment)

For the first case, chmod + X program can be chmod +x program by adding execution permissions
In the second case, it is recommended to copy over the binary package of the program and recompile the program. In the actual operation process, I found that when I packaged the entire operating system environment of VPS in the United States and downloaded it to the local server, after unzipping it, the program running it would appear as shown in the question. I was puzzled. The system was all CENTOS5.2, and finally I found that it was caused by the difference between the two compilation environments:
1.The US VPS is the AMD64-bit processor

2.the local server is the Intel 32-bit processor

The hardware compilation environment of the two is different, which causes this problem. Of course, some programs downloaded from the non-binary package, can be executed directly, but the problem is also because the kernel does not match the CPU, Intel is x86, AMD is AMD64 or 32-bit version, corresponding to clear download. I hope this article will be helpful to you.