powershell openssh

PowerShell中如何获取前几天和后几天

$date=Get-Date$date=$date.AddDays(-1) #获取前1天,如果想获取后1天,将-1换成1即可$date=$date.ToString("yyyy_MM_dd") #格式化打印日期 ......
PowerShell

LInux升级OpenSSH脚本

建议大家在虚拟机上试过之后再去生产环境执行。 次脚本可以从7.4升级到9.3p1,本人亲自验证过了 #!/bin/bash echo backup sshd_config to /etc/ssh/sshd_config.bak cp /etc/ssh/sshd_config /etc/ssh/ssh ......
脚本 OpenSSH LInux

OpenSSH版本升级漏洞修复问题

- 👋 Hi, I’m @Merbelue 大家好,这篇为大家介绍二进制方式对OpenSSH版本升级,在生产环境中可用于解决版本升级、漏洞修复等。 @[TOC](目录) #### 1、环境 - 系统版本:CentOS 7.6 - OpenSSH、OpenSSL版本:OpenSSH_7.4p1、Op ......
漏洞 OpenSSH 版本 问题

openssh 编译安装 封装rpm

tar -zxf openssl-1.1.0k. tar.gz yum -y install wget pam* yum install -y perl rpm-build gcc gcc-c+i glibc glibc-devel openss1-devel openssl prce pcre-d ......
openssh rpm

PowerShell 命令补全

一、 PSReadLine PSReadLine - Powershell 的强化工具 Powershell PSReadLine Complete Word(History) 根据历史补全词 psreadline是一个在PowerShell中使用的命令行编辑器模块。它提供了对命令行的自动完成、历史 ......
PowerShell 命令

Windows 安装 OpenSSH

`官方介绍地址:`https://learn.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_install_firstuse ## 安装方式 #### 1.使用设置 -> 应用进行安装 ![image](https ......
Windows OpenSSH

PowerShell 使用SqlScriptDOM对T-SQL做规则校验

​ 对于数据项目来说,编写Sql是一项基本任务同时也是数量最多的代码。为了统一项目代码规范同时降低Code Review的成本,因此需要通过自动化的方式来进行规则校验。由于本人所在的项目以SQL Server数据库为基础,于是本人决定通过使用SqlScriptDom类库来做T-SQL的规则校验。如果 ......
SqlScriptDOM PowerShell 规则 T-SQL SQL

将powershell的编码默认改为UTF-8

引用地址:https://blog.csdn.net/qq_39494169/article/details/122561317 之前因为VScode默认的编码格式是UTF-8,但是终端powershell是GBK编码,所以打印出来的中文是乱码。在网上看过很多教程,什么修改注册表,或者在VScode ......
powershell 编码

win11 PowerShell关闭拆分选项卡窗框窗口

PowerShell拆分窗格 ### 一、拆分选项卡窗格 **1.鼠标操作:** ![image](https://img2023.cnblogs.com/blog/597729/202308/597729-20230809094954658-2060218793.png) **2.快捷键操作:Al ......
窗框 PowerShell win 11

windows powershell scoop Get-Service

scoop 在执行时ps1`Get-Service`错误 `Get-Service: ServiceController enables manipulating and accessing Windows services and it is not applicable for other op ......
Get-Service powershell windows Service scoop

[转]PuTTY的ppk密钥与OpenSSH密钥之间的相互转换

在手机上使用juiceSSH用密钥连接服务器,以前是用win10 命令行生成的私钥,使用没有问题,这次换了MobaXterm带的工具(后来发现应该是开源的PuTTY项目里的工具)生成的密钥,就登不上了,最后用文本编辑器打开两种密钥,发现格式大不一样,遂查找转换方法,找到一篇说的比较明白,特转载备用: ......
密钥 之间 OpenSSH PuTTY ppk

OpenSSH 资源管理错误漏洞(CVE-2021-28041)

# OpenSSH 资源管理错误漏洞(CVE-2021-28041) 漏洞描述: OpenSSH(OpenBSD Secure Shell)是Openbsd计划组的一套用于安全访问远程计算机的连接工具。 该工具是SSH协议的开源实现,支持对所有的传输进行加密,可有效阻止窃听、连接劫持以及其他 网络级 ......
漏洞 资源管理 错误 OpenSSH 资源

openssh升级后造成 登录 出现-bash: ulimit: open files

现象: openssh升级后造成 登录 出现-bash: ulimit: open files 解决方案: (1) # vim /etc/pam.d/login ==>session required pam_limits.so (2) # vi /etc/ssh/sshd_config ==>Us ......
openssh ulimit files bash open

在当前窗口打开cmd或者powershell

powershell:在当前目录按住shift再右键。会看到右键菜单里有一个“在此处打开命令窗口”选项,点击即可。也可以用快捷键操作:shift+右键 => 按W键 => 按Enter键。输入 start cmd 回车 cmd在当前目录上面的路径显示框中输入CMD,然后回车即可。 ......
powershell cmd

使用powershell找回丢失的RDCManager密码

内网的一台服务器上的装机默认用户密码忘记了,但是好在别的电脑上使用RDCMan(Remote Desktop Connection Manager)连接过这台服务器,并且保存了密码。于是经过一番折腾,最后把密码找回来了: 最后成功的powershell脚本来自于这个地址: https://www.u ......
powershell RDCManager 密码

使用Go调用Powershell加域

```golang package main import ( "fmt" "github.com/go-ldap/ldap/v3" "github.com/mozillazg/go-pinyin" "os" "os/exec" "strings" "time" ) func ChineseToAb ......
Powershell

(保姆级图文)如何使用PowerShell连接Exchange Online

直接开始菜单 -> 所有程序 -> Windows PowerShell -> Windows PowerShell 然后右键使用管理员权限打开 打开后窗口如下 #连接 Exchange Online PowerShell #为了使从 Internet 下载的所有 PowerShell 脚本能够由受 ......
PowerShell 保姆 Exchange 图文 Online

Centos7 离线升级openssh到9.3p1

参考:https://blog.csdn.net/qq_29768197/article/details/125048720 参考:https://blog.csdn.net/weixin_46739058/article/details/129189927 1、官方下载地址: http://www ......
Centos7 openssh Centos 9.3 p1

PowerShell 获取win 电脑磁盘信息

$physicalDrives = Get-WmiObject Win32_DiskDrive $totalPhysicalStorageSize = $physicalDrives | Measure-Object -Property Size -Sum | Select-Object -Expa ......
磁盘 PowerShell 电脑 信息 win

PowerShell 获取接在电脑上显示器的序列号,支持多个

$Monitors = Get-WmiObject WmiMonitorID -Namespace root\wmi function Decode { If ($args[0] -is [System.Array]) { [System.Text.Encoding]::ASCII.GetStrin ......
序列号 序列 PowerShell 显示器 多个

centos7 openssh升级到9.3.p1

配置openssh目录cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak cp /etc/pam.d/sshd /etc/pam.d/sshd.bak mkdir -p /root/openssh cd /root/openssh 上传已经制作好的ope ......
centos7 openssh centos p1

使用 bat 脚本调用 powershell 脚本时遇到的问题

如果 powershell 脚本中,有一些涉及相对路径的操作,会发现这样运行的 powershell 并不是在期望的目录中,需要重新设置一下当前工作目录: powershell -Command Set-Location -LiteralPath "%cd%"; ".\test.ps1" 通过 Se ......
脚本 powershell 问题 bat

PowerShell实现Win11环境变量追加及备份

# PowerShell实现Win11环境变量追加及备份 最近重装了系统,之前配置的环境又得重新配置,感觉很繁琐所以查阅资料实现了用脚本配置环境变量,这样只要保留原先的JDK等环境文件夹就可以一键配置了。 一开始我准备采用比较熟悉的bat脚本来实现 ```bat setx PATH "%PATH%; ......
变量 PowerShell 备份 环境 Win

powershell首次运行报:无法加载xxxx,因为此系统禁止运行脚本错误

解决: 使用管理员身份运行 PowerShell,然后输入 set-executionpolicy remotesigned得到以下提示: 执行“set-ExecutionPolicy RemoteSigned ”: 执行策略更改 执行策略可以防止您执行不信任的脚本。更改执行策略可能会使您面临 ab ......
脚本 powershell 错误 系统 xxxx

powershell随笔

[toc] # powershell随笔 > 忘记时来看。。。 ## 字符串相关函数 ### `-match` ```powershell #Format [value] #Logic Matches at least one of the characters in the brackets. " ......
powershell 随笔

PowerShell命令卸载 Windows系统预装内置软件

一、【核心命令】 Get-AppxPackage -AllUsers /* 获取Win10以上系统(所有用户)预装软件 */ Get-AppxPackage -AllUsers {预装软件全名} | Remove-AppxPackage /* 管道方式卸载Win10以上系统预装软件 */ Remov ......
PowerShell 命令 Windows 系统 软件

openssh升级(centos7.6)

OpenSSH升级 上传软件包openssh-8.1p1.tar.gz1.安装telnet服务 yum -y install telnet-server* telnet (yum install -y xinetd ) vi /etc/xinetd.d/telnet (将其中disable字段的ye ......
openssh centos7 centos

OpenSSH升级后 libcrypto.so.1.1: cannot open shared object file

之前分享过一篇[记一次手动将OpenSSH从7.4升级到9.3的过程](https://www.cnblogs.com/jianzhan/p/ssh-update.html) 这次又升级时,政务云提供了更加便捷的升级方案 给了一个升级文件:`Openssl_UPDATE_to_9.2p1.bin`和 ......
libcrypto OpenSSH cannot object shared

在 PowerShell 中,若执行脚本所在路径包含通配符时,会导致 Start-Process 出错

比如在这样的路径:D:\[测试1]脚本测试\test 如果执行 Start-Process ..\setchar.exe 会报错: Start-Process : 无法执行操作,因为通配符路径 D:\[测试1]脚本测试\test 无法解析为文件。 所在位置 行:1 字符: 1 ...... 下面虽然 ......

powershell删除C盘无用文件

cls$FileAge = $(Get-Date).AddDays(-60)# $server = ( Get-Content D:\ServerList.txt)write-host "$server -- Ping Success" -ForegroundColor Green$Pingstat ......
powershell 文件