[内容] WordPress 网站数据去隐私化

内容一:修改登录 MariaDB 数据库的用户的密码

1.1 目的

目的是不让拿到这份 WordPress 网站数据的人知道登录数据库的用户的密码

1.2 案例

1.2.1 设置变量
1.2.1.1 要设置的变量

1) WordPress 登录 MariaDB 数据库的用户
2) 登录 MariaDB 数据库的用户的新密码

1.2.1.2 设置变量的命令
# dbuser=ec
# dbuserpw=eternalcenter
1.2.2 执行修改登录 MariaDB 数据库的用户的密码的命令
# mysql -uroot -p'eternalcenter' -e "alter user \"$dbuser\"@\"localhost\" identified by \"$dbuserpw\";"
# sudo sed -i "s/define('DB_PASSWORD', .*);/define('DB_PASSWORD', \'$dbuserpw\');/" wp-config.php

(注意:这里的 ”mysql -uroot -p’eternalcenter’ ……”“ 中 “eternalcenter“ 是指 MariaDB 数据库 root 用户的密码,需要修改成 MariaDB 数据库的 root 用户密码)

内容二:修改 MariaDB 数据库中用于登录 WordPress 网站后台的用户的密码

2.1 目的

目的是不让拿到这份 WordPress 网站数据的人知道登录网站的用户的密码,同时杜绝别人利用存储在 MariaDB 数据库中密码的 HASH 值伪造网站 Cookie 直接绕过用户和密码登录 WordPress 后台

2.2 案例

2.2.1 设置变量
1.2.1.1 要设置的变量

1) 要修改用户密码所在的库
2) 要修改用户密码所在的表
3) 要修改密码的用户
4) 此用户的新密码

1.2.1.2 设置变量的命令
# db=ec
# tb=ec_users
# user='Mingyu Zhu'
# newpw=eternalcenter
1.2.2 执行修改 MySQL 数据库中用于登录 WordPress 网站后台的用户的密码的命令
# mysql -uroot -p'eternalcenter' -e "update $db.$tb set user_pass = md5(\'$newpw\') where user_login = \'$user\';"

(注意:这里的 ”mysql -uroot -p’eternalcenter’ ……”“ 中 “eternalcenter“ 是指 MariaDB 数据库 root 用户的密码,需要修改成 MariaDB 数据库的 root 用户密码)

(补充:当他人想要伪造网站 Cookie 时至少需要 WordPress 网站文件中 AUTH_KEY 等参数的值、MariaDB 数据库中存储的密码的部分 HASH 值、以及 WordPress 网站临时生成的一个 Token,我们这里通过隐藏原网站的密码 HASH 值杜绝他人伪造网站 Cookie)

内容三:修改 WordPress 网站文件中的 AUTH_KEY 等参数的值

杜绝别人利用存储在 WordPress 网站文件的 AUTH_KEY 等参数的值伪造网站 Cookie 直接绕过用户和密码登录 WordPress 后台

3.1 在 WordPress 项目的官方网站上获得一份新的 AUTH_KEY 等参数的值

通过浏览器打开下面的网址

https://api.wordpress.org/secret-key/1.1/salt

(补充:如果网路正常,新的 AUTH_KEY 等参数的值会在浏览器中显示)

3.2 更新 WordPress 网站文件中的 AUTH_KEY 等参数的值

# vi wp-config.php

(用在步骤 3.1 中获取的新值覆盖对应的旧值,步骤略)

(补充:当他人想要伪造网站 Cookie 时至少需要 WordPress 网站文件中 AUTH_KEY 等参数的值、MariaDB 数据库中存储的密码的部分 HASH 值、以及 WordPress 网站临时生成的一个 Token,我们这里通过隐藏原网站的 AUTH_KEY 等参数的值杜绝他人伪造网站 Cookie)

[DEBUG] SUSE Repository Mirroring Tool (RMT) resolve client use SUSEConnect command output ‘Error: Registration server returned ‘Internal Server Error’ (500)’ or ‘SUSEConnect error: trying to send a keepalive from a system not yet registered. Register this system first’

Error Reporting Command

# SUSEConnect --url

or:

# SUSEConnect --de-register

Error Code

Error: Registration server returned 'Internal Server Error' (500)

or:

SUSEConnect error: trying to send a keepalive from a system not yet registered. Register this system first

Solution 1: Make sure the /tmp directory has enough space

Step One: Make sure the /tmp directory has enough space

# df -h

At this point, ensure that the directory occupancy is not 100% based on the output content.

Step Two: Restart rmt-server

# systemctl restart rmt-server

Solution 2: Change the cache directory

Step One: Make new cache directory

# mkdir /var/rmttmp

(Note: here is an example with making the new cache directory named /var/rmttmp)

Step Two: Change the owner of the new cache directory

# chown -R _rmt:nginx /var/rmttmp

(Note: here is an example with changing the owner of directory named /var/rmttmp)

Step Three: Change the

# systemctl edit rmt-server-mirror.service

Change partial content as follow:

[Service]
Environment=
Environment="LOG_TO_JOURNALD=1" "LANG=en" "TMPDIR=/var/rmttmp/"

(Note: here is an example with setting the new cache directory to /var/rmttmp/)

Step Four: Restart rmt-server-mirror.service

# systemctl daemon-reload
# systemctl restart rmt-server-mirror.service

Reference

https://support.scc.suse.com/s/kb/RMT-mirroring-fails-when-tmp-runs-out-of-disk-space?language=en_US

[DEBUG] Linux resolve at command error ‘PAM failure: Authentication service cannot retrieve authentication info’

Error Reporting Command

> at

Error Code

PAM failure: Authentication service cannot retrieve authentication info

Reason

This user which inputted at command did not have password so there is no record relate to it in /etc/shadow file.
And at command need check the record in the file /etc/shadow.
If at command can not find the user's record in /etc/shadow, it output this error code.

Solution

And password to the suer:

> passwd

[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 (软件源) (自定义软件源版)

正文:

内容一:显示自定义软件源

# rmt-cli repos custom list

内容二:启用自定义软件源

# rmt-cli repos custom add <URL> <Customize Name>

内容三:删除自定义软件源

# rmt-cli repos custom remove <Customize Name>

参考文献:

https://documentation.suse.com/sles/15-SP4/single-html/SLES-rmt/index.html#sec-rmt-tools-rmt-cli