通过powershell查看谁重启了服务器

通过powershell可以很方便的查询谁重启过服务器,对于Server Core尤其方便。服务器重启的事件ID为1074.查询命令为

Get-WinEvent -LogName system | Where-Object ID -eq 1074

安装OpenSSH for Windows

下面是在powershell中操作的命令记录

choco install powershell-core -y
choco install openssh
cd C:\Program Files\OpenSSH-Win64
Set-ExecutionPolicy RemoteSigned
#设置默认shell为powershell
.\Set-SSHDefaultShell.ps1 -PathSpecsToProbeForShellEXEString "\$env\:userprofile\downloads\*.exe;c:\Program Files\PowerShell\*\P\*.exe;c:\windows\system32\*"

#配置认证用authorized_keys
#系统管理员需要把authorized_keys保存到C:\ProgramData\ssh\下面,并命名为administrators_authorized_keys
#配置authorized_keys权限
icacls.exe ""$env:ProgramData\ssh\administrators_authorized_keys"" /inheritance:r /grant ""*S-1-5-32-544:F"" /grant ""SYSTEM:F""
# 大工完成

OpenSSH for Windows 中基于密钥的身份验证 | Microsoft Learn

在alpine Linux上运行 besttrace

在 alpine Linux上运行 besttrace时,报错no such file or directory,应该是缺少库文件,安装gcompat解决。

Zabbix 报警不工作

zabbix接受邮件通知的用户需要对生成报警日志的主机具有至少读取的权限。此权限只能授予用户所在的群组。具体操作方法是【administration】- 【User groups】-【用户所在的组】-【Permissions】选择服务器组并添加“read”权限。

常见软件静默安装参数

Installshield

  • 录制iss文件
Setup.exe -r -f1"c:\setup.iss"
  • 静默安装
setup.exe /s /f1"C:\setup.iss" /f2"c:\setup.log"
  • 卸载
setup.exe -r -f1uninstall.iss
setup.exe -s -f1uninstall.iss

NetBackup Administration Console 登录 错误码7656

今日登录NBU 管理控制台,报错,错误码为7656.

“Unable to login, status: 7656. The revocation status of the host certificate cannot be verified using the Certificate Revocation List (CRL) because the CRL expired. The CRL is older than 7 days.”

根据帮助文件,手动更新 CRL,失败。

CentOS Ipv6 Tentative Noprefixroute Dadfailed

有几台CentOS7的虚拟机,都是克隆出来的,发现IPv6本地链路地址报tentative noprefixroute dadfailed,仔细对比IPv6 本地链路地址,都是一样的。

问题是它是本地链路地址,没法删除,只能去查找资料。原来本地链路地址是NetworkManger通过secret_key得来的,而secret_key是通过machine_id得来的。克隆的时候把machine_id 一同复制过来了,所以导致本地链路地址一样。那么问题就好解决了。