分类 电脑 下的文章

在Windows PE里设置静态IP,wget下载文件,运行tvnserver远程连接

感谢:对你一辈子的想念

Windows PE的版本是10 64位。过程如下:

1.如微软官方的PE不含网卡驱动,可用 dism++ 加上驱动。使用ipconfig查看网卡配置信息,如本例活动网卡名称是 Ethernet,没成功获得公网IP
winpe-1.png

2.可用netsh命令来配置静态IP,如本例的:

netsh interface ip set address name="Ethernet" static 144.172.126.32 255.255.255.0 144.172.126.1 1
netsh interface ip set dns name="Ethernet" static 8.8.8.8

winpe-2.png

3.本例在PE中保存了\mytools\set-ip.bat的脚本,方便运行
winpe-3.png

4.如果IP配置正确,可ping外网成功
winpe-4.png

5.本例在PE中保存了\mytools\wget.exe,方便从网上下载文件,本例下载的是tvnserver.zip
winpe-5.png

6.本例在PE中保存了\mytools\7-zip\,可使用\mytools\7-zip\7zfm.exe 来进行文件管理,如解压之类操作
winpe-6.png

7.tvnserver.zip中包含start-tvnc.bat的脚本,方便禁用防火墙,导入有密码(drserver)设置的tvnserver注册表内容,启动tvnserver
winpe-7.png

8.这是start-tvnc.bat的脚本内容
winpe-8.png

9.start-tvnc.bat的脚本执行结果
winpe-9.png

10.如果tvnserver启动,会监听5900端口
winpe-10.png

11.如果tvnserver的注册表未成功导入,可能会报密码验证错误:Authentication reason:Server is not configured properly
winpe-11.png

12.从本地,用tvnviewer连接测试,成功
winpe-12.png

参考:

用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服务

参考: