安装 scoop 包管理器
- 使用管理员权限打开 PowerShell,查看当前版本
$PSVersionTable.PSVersion
- Windows 7 自带 PowerShell 2.0,需升级到 PowerShell 5.1
PowerShell 5.1 安装包(升级后需重启系统)
链接: https://pan.baidu.com/s/1OWY8-hW-J-Sr1-8ZHs2JWQ
提取码: 6332
- 修改 PowerShell 执行脚本权限
Set-ExecutionPolicy RemoteSigned -Force
- 修改 scoop 默认安装路径
$env:SCOOP='D:\\Software\\scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
- 修改 scoop 全局程序安装路径
$env:SCOOP_GLOBAL='D:\\Software\\scoop'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
- 安装最新版 scoop
iwr -useb get.scoop.sh | iex # 已废弃
irm get.scoop.sh -Proxy 'http://127.0.0.1:58591' | iex
- 配置 scoop 代理
scoop config proxy 127.0.0.1:58591
- 使用 scoop 安装 aria2,git
scoop install aria2 git
安装 cygwin 类 UNIX 模拟环境
- 安装 cygwin
scoop install cygwin
- 更换软件源下载地址
- 选择 Install from Internet, 在 ”User URL” 处输入以下地址:
https://mirrors.tuna.tsinghua.edu.cn/cygwin/
注意,该列表为可多选列表,注意把上面不需要的镜像点掉。
安装 openssh
- 打开安装好的 Cygwin Setup,安装 openssh
- 使用管理员权限打开 PowerShell,进入 cygwin
cygwin
- 安装 sshd 服务
ssh-host-config # 服务名称输入 ntsec
- 配置 windows 用户本地认证(即使用 windows 的用户名和密码登录)
mkpasswd -l > /etc/passwd
mkgroup -l > /etc/group
- 开启 ssh 服务
net start cygsshd
# 或
cygrunsrv -S cygsshd
- 停止 ssh 服务
net stop cygsshd
- 用户需要设置账号密码才能使用
安装 winscp
- 使用包管理器安装 winscp
scoop install winscp
- 测试 ssh 服务是否可用