liujia 发布的文章

用IPMI的Virtual Storage上传加载本地的iso文件

机子是超微带ipmi的,可以通过ipmi控制台里的 Virtual Storage 菜单,加载本地的iso文件。

过程:

1.打开ipmi控制台,选择菜单 Virtual Media -- Virtual Storage
ipmi-load-iso-file-1.png

2.在弹出的窗口里,Device1 -- Logical Drive Type 选择 ISO file, Image File Name and Full Path 里选择本地的iso文件,之后点击 Plug in 按钮。如果顺利,在 Connection Staus History 里会显示 Device1: VM Plug-in OK!! 表示成功设置
ipmi-load-iso-file-2.png

3.之后,重启机子,按F11,选择启动设备
ipmi-load-iso-file-3.png

4.本例是选择 ATEN Virtual CDROM YSOJ,来从iso文件启动
ipmi-load-iso-file-4.png

5.如果线路上传慢,可能要等20分钟左右才成功从iso文件启动,本例约300MB的Windows PE,耗时约25分钟
ipmi-load-iso-file-5.png

参考:https://www.supermicro.org.cn/manuals/other/IPMIView20.pdf

vestacp 新增ftp用户 登录遇到 530 错误

环境:centos 7 64位,安装脚本 https://github.com/duy13/VDVESTA/blob/master/README.md

过程:

1.安装好vdvesta,新增ftp用户如 admin_liujia ,用ftp客户端连接,提示 530 Login incorrect
vestacp-ftp-530-1.png

2.查看 /etc/vsftpd/vsftpd.conf 配置文件,知 vsftpd 是使用本地用户账户

3.查看 /etc/passwd ,知新增的 admin_liujia 的shell路径是 /sbin/nologin
vestacp-ftp-530-2.png

4.编辑 /etc/shells 文件,添加一行 /sbin/nologin
vestacp-ftp-530-3.png

5.再从ftp客户端连接,正常登录

参考:https://forum.vestacp.com/viewtopic.php?t=16461

在 CentOS7 里安装 openssh-7.9p1

CentOS 7.5的openssh版本是 openssh-7.4p1-16.el7.x86_64,如需使用 openssh-7.9p1 版本,可参考下列。

过程:

1.先安装新版本的openssl,如openssl-1.1

2.yum install -y pam-devel openssl-devel # 安装相应的组件

3.wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.9p1.tar.gz # 下载安装文件

4.tar xzvf openssh-7.9p1.tar.gz # 解压

5.cd openssh-7.9p1 # 进到文件目录

6../configure -prefix=/usr -sysconfdir=/etc/ssh -with-md5-passwords -with-pam -with-ssl-dir=/usr/include/openssl -without-hardening # 配置

7.make # 编译

8.mv /etc/ssh /etc/ssh-bak # 移走现有的ssh配置目录

9.make install # 安装

10.echo "PermitRootLogin yes" >> /etc/ssh/sshd_config # 允许root用户远程登录

11.cp contrib/redhat/sshd.init /etc/init.d/sshd # 复制sshd启动文件

12.chmod +x /etc/init.d/sshd # 给执行权限

13.chkconfig --add sshd # 添加服务

14.chkconfig sshd on # 设置自动启动

15.vi /usr/lib/systemd/system/sshd.service # 编辑配置文件,注释掉相关行,禁止自动启动,因为发现安装新版本openssh后,日志不断记录启动失败和自动启动

[Unit]
Description=OpenSSH server daemon
Documentation=man:sshd(8) man:sshd_config(5)
# After=network.target sshd-keygen.service
# Wants=sshd-keygen.service
After=network.target

[Service]
# Type=notify
# EnvironmentFile=/etc/sysconfig/sshd
# ExecStart=/usr/sbin/sshd -D $OPTIONS
ExecStart=/usr/sbin/sshd
# ExecReload=/bin/kill -HUP $MAINPID
# KillMode=process
# Restart=on-failure
# RestartSec=42s

[Install]
WantedBy=multi-user.target

16.systemctl daemon-reload # 重载服务

17./etc/init.d/sshd restart # 重启sshd服务

参考:

在CentOS 7 安装 OpenSSL 1.1.1a

CentOS7.5里的openssl版本是 OpenSSL 1.0.2k-fips 26 Jan 2017 ,如需较新版本的,可自行尝试下载安装。

过程:

1.yum install libtool perl-core zlib-devel -y # 安装相应的组件

2.wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gz # 下载安装文件包

3.tar xzvf OpenSSL_1_1_1a.tar.gz # 解压

4.cd openssl-OpenSSL_1_1_1a # 转到文件包目录

5../config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib # 配置

6.make

7.make install

8.vi /etc/profile.d/openssl.sh # 创建openssh配置文件,使用新版本的openssl,不直接替换原有的

# /etc/profile.d/openssl.sh
pathmunge /usr/local/openssl/bin

9.vi /etc/ld.so.conf.d/openssl-1.1.conf # 创建lib配置文件

/etc/ld.so/conf.d/openssl-1.1.conf

/usr/local/openssl/lib

10.ldconfig -v # 让openssh新版本lib路径生效

参考:https://blacksaildivision.com/how-to-install-openssl-on-centos

升级mysql5.5到mysql5.7,查询警告 - this is incompatible with sql_mode=only_full_group_by

问题:升级mysql到5.7,导入mysql5.5的数据库,站点日志中,有类似 this is incompatible with sql_mode=only_full_group_by 的警告。

解决:在mysql的配置文件mysql.ini里加sql_mode的参数,如下边的内容:

[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

原因可能是新版本的mysql5.7与原sql查询语句不“兼容”。

参考:https://stackoverflow.com/questions/34115174/error-related-to-only-full-group-by-when-executing-a-query-in-mysql