2025年8月

  1. 生成新密钥,并上传公钥到服务器

    # 生成新密钥
    ssh-keygen -t rsa -m PEM -b 4096 -C "邮箱"
    # 提示可以输入密码,今后认证时服务器和本地用密钥认证,密码用来验证密钥
    
    # 上传公钥到服务器
    scp ~/.ssh/id_rsa.pub 用户名@服务器:~/.ssh/authorized_keys
  2. PowerShell中ssh连接

    ssh 用户名@服务器
    # 可见提示的密码认证是认证本地密钥

    PixPin_2025-08-31_21-42-22.png

  3. Putty中连接
    puttygen打开私钥,提示格式太老,菜单key \ 保存参数设置一下,另存为ppk格式的putty密钥。
    PixPin_2025-08-31_21-35-39.png
    putty中打开保存的会话,connection \ SSH \ Auth \ Credentials,打开之前保存的ppk密钥,重新保存会话。
    PixPin_2025-08-31_21-46-43.png
  4. 参考
    https://blog.csdn.net/black_cat7/article/details/139457572
    https://zhuanlan.zhihu.com/p/587082161
    https://www.dell.com/support/kbdoc/zh-cn/000217157/connectrix-b-series-how-to-use-putty-for-ssh-key-based-authentication
    https://blog.csdn.net/chenzhengfeng/article/details/125827015
    https://blog.csdn.net/knight_zhen/article/details/47001449

  1. socks5代理转http代理
    安装scoop需要代理翻墙,且只能走http代理,不支持socks5代理。
    naiveproxy只有新版本才能同时设置socks5代理,但新版本却不支持Windows 8.1, 只能通过privoxy来中转。
    privoxy配置文件config.txt中修改一句、新增一句配置

    listen-address  127.0.0.1:1090
    forward-socks5t   /               127.0.0.1:1080  .
  2. https问题
    安装scoop时出现错误Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel.

    如果客户端尝试使用TLS 1.0协商请求,但只支持TLS 1.1和1.2,则会出现此错误。
    在向您的服务发出请求之前,尝试通过将以下代码添加到客户端应用程序来强制客户端使用TLS1.2。
    Powershell

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  3. Powershell版本过低
    下载并安装Windows管理框架5.1
    https://tips.pfrlju.com/tech/jacki/updating-powershell-version-on-windows.html

    这里看貌似Windows 7也是一样的操作
    https://www.cnblogs.com/heenhui2016/p/11037607.html