AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-312002

shaneoh's questions

Martin Hope
shaneoh
Asked: 2019-05-27 19:18:39 +0800 CST

使用 OpenVPN 时 RDP 不可用

  • 0

我已经被这个问题困扰了好几天了。

我目前在自托管服务器上运行 OpenVPN 服务器。我们的员工使用此功能,以便在从远程位置登录 VPN 后,他们能够访问我们办公室网络中的资源。其主要用途是使用 RDP 连接到 Windows 机器。

我们需要将其迁移到云端。我们已经建立了一个测试环境,AWS VPNs 从我们的办公室连接到一个 Transit Gateway,该网关连接到各种 VPC。其中一个 VPC 包含一个实例,我在该实例上运行一个 OpenVPN 服务器,该服务器几乎与当前 VPN 的配置相匹配,只是做了一些小改动。然而,虽然 RDP 使用当前的 OpenVPN 安装工作得非常好,但使用云托管的 OpenVPN 安装却无法使用。无法使用我的意思是:

  • 尝试播放 YouTube 剪辑以便我们可以测试帧速率,播放立即冻结长达 10 秒,然后 RDP 会话断开连接
  • 当做任何不涉及视频的事情时,它通常会工作一两分钟,然后一切都冻结,一段时间后会话断开

所以我们能够很好地连接,但显然有些东西没有按应有的方式运行,我已经尝试了我能想到的一切。这些是当前可用的自托管 OpenVPN 服务器的详细信息。

  • CentOS 6.10
  • 开放VPN 2.4.7

和内容server.conf:

local 192.168.1.103
port 1194
proto tcp
dev tun
cert /etc/openvpn/keys2/mycert
key /etc/openvpn/keys2/mykey

dh /etc/openvpn/keys2/dh.pem

server 10.8.0.0 255.255.255.0

topology subnet

route 192.168.2.0 255.255.255.0

push "route 10.8.0.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"

push "dhcp-option DNS 192.168.1.1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

client-config-dir /etc/openvpn/ccd

client-to-client

duplicate-cn

keepalive 20 600

cipher AES-128-CBC

max-clients 100

user nobody
group nobody

persist-key
persist-tun

status /var/log/openvpn/openvpn-status.log

log         /var/log/openvpn/openvpn.log

verb 4

username-as-common-name

plugin /usr/lib64/openvpn/plugins/openvpn-plugin-auth-pam.so openvpn
reneg-sec 0

management localhost 17505
compress lz4
mssfix 1432
mute 10
ifconfig-pool-persist ipp.txt
key-direction 0

tcp-queue-limit 256

verify-client-cert none

云 OpenVPN 服务器的详细信息:

  • CentOS 7.6.1810
  • 开放VPN 2.4.7

以及内容server.conf:

port 1194

proto udp

dev tun

username-as-common-name

ca /etc/certs/ca.crt
cert /etc/certs/server.crt
key /etc/certs/server.key  

dh /etc/certs/dh2048.pem

server 10.8.0.0 255.255.255.0

topology subnet

push "route 10.8.0.0 255.255.255.0"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

client-config-dir /etc/openvpn/ccd

client-to-client

duplicate-cn

keepalive 20 600

tcp-queue-limit 256

cipher AES-256-CBC
auth SHA256

max-clients 100

user nobody
group nobody

persist-key
persist-tun

status /var/log/openvpn/openvpn-status.log

log         /var/log/openvpn/openvpn.log

verb 4

plugin /usr/lib64/openvpn/plugins/openvpn-plugin-auth-pam.so openvpn
reneg-sec 0

compress lz4
mssfix 1432
mute 10
ifconfig-pool-persist ipp.txt
key-direction 0

verify-client-cert none

您可以看到某些路由是必要的。此外,虽然目前新服务器正在使用 UDP,如下所述,这是因为我已更改此设置以尝试解决问题。

这是我尝试过的:

  • 尝试了 TCP 和 UDP(UDP 在办公室里对我们来说从来都不是很好,所以我们已经使用 TCP 多年了)
  • MTU 设置的许多变化,从 500 到 2500,以许多增量
  • 将密码更改为 AES-128-CBC
  • 所有可用的 RDP 颜色和带宽设置
  • 各种 RDP 显示尺寸设置
  • TightVNC,效果很好,但不幸的是不是一个解决方案。我只是想确定这个问题是 RDP 特有的

将不胜感激任何想法,因为我没有他们。

openvpn
  • 1 个回答
  • 2525 Views
Martin Hope
shaneoh
Asked: 2018-10-05 06:13:47 +0800 CST

AWX 模板未获取 AWS 凭证

  • 0

我有一个新的 Ansible AWX 服务器正在运行,我想做的一件事是创建 AWS 实例的 AMI,然后再安装实例的定期更新。

我的剧本在安装更新方面运行良好,但我无法让 AWX UI 通过模板正确传递 AWS 凭证。

我正在运行一个仅创建 AMI 的测试模板,并且我始终失败并显示有关未找到凭据的消息。

AWX 有一个凭证部分。我添加了具有执行此操作权限的 IAM 用户的访问密钥和秘密密钥。尽管将该凭据添加到作业模板,但这是我得到的输出:

{
    "_ansible_parsed": true,
    "exception": "Traceback (most recent call last):\n  File \"/tmp/ansible_fj8G6M/ansible_module_ec2_ami.py\", line 433, in create_image\n    image_id = connection.create_image(**params).get('ImageId')\n  File \"/usr/lib/python2.7/site-packages/botocore/client.py\", line 320, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n  File \"/usr/lib/python2.7/site-packages/botocore/client.py\", line 610, in _make_api_call\n    operation_model, request_dict)\n  File \"/usr/lib/python2.7/site-packages/botocore/endpoint.py\", line 102, in make_request\n    return self._send_request(request_dict, operation_model)\n  File \"/usr/lib/python2.7/site-packages/botocore/endpoint.py\", line 132, in _send_request\n    request = self.create_request(request_dict, operation_model)\n  File \"/usr/lib/python2.7/site-packages/botocore/endpoint.py\", line 116, in create_request\n    operation_name=operation_model.name)\n  File \"/usr/lib/python2.7/site-packages/botocore/hooks.py\", line 356, in emit\n    return self._emitter.emit(aliased_event_name, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/botocore/hooks.py\", line 228, in emit\n    return self._emit(event_name, kwargs)\n  File \"/usr/lib/python2.7/site-packages/botocore/hooks.py\", line 211, in _emit\n    response = handler(**kwargs)\n  File \"/usr/lib/python2.7/site-packages/botocore/signers.py\", line 90, in handler\n    return self.sign(operation_name, request)\n  File \"/usr/lib/python2.7/site-packages/botocore/signers.py\", line 157, in sign\n    auth.add_auth(request)\n  File \"/usr/lib/python2.7/site-packages/botocore/auth.py\", line 356, in add_auth\n    raise NoCredentialsError\nNoCredentialsError: Unable to locate credentials\n",
    "_ansible_no_log": false,
    "botocore_version": "1.12.16",
    "changed": false,
    "invocation": {
        "module_args": {
            "enhanced_networking": null,
            "purge_tags": false,
            "launch_permissions": null,
            "ramdisk_id": null,
            "no_reboot": false,
            "ec2_url": null,
            "aws_secret_key": null,
            "billing_products": null,
            "state": "present",
            "virtualization_type": "hvm",
            "sriov_net_support": null,
            "architecture": "x86_64",
            "profile": null,
            "image_location": null,
            "description": "",
            "tags": {
                "Name": "i-sdfsdf987987"
            },
            "kernel_id": null,
            "image_id": null,
            "wait_timeout": 900,
            "wait": false,
            "aws_access_key": null,
            "name": "i-sdfsdf987987",
            "security_token": null,
            "delete_snapshot": false,
            "region": "eu-west-2",
            "instance_id": "i-sdfsdf987987",
            "root_device_name": null,
            "validate_certs": true,
            "device_mapping": null
        }
    },
    "msg": "Error registering image: Unable to locate credentials",
    "boto3_version": "1.9.16"

这是我的剧本:

---
- hosts: all
  remote_user: "{{ remote_user }}"
  become: yes
  tasks:
    - name: create an ami
      ec2_ami:
        instance_id: "{{ instance_id }}"
        name: "{{ instance_id }}"
        region: "{{ aws_region }}"
        tags:
          Name: "{{ instance_id }}"

如果我在 AWX UI 中手动将凭据添加为主机上的变量,则添加以下行:

aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"

那么一切都很好。但这似乎忽略了使用 AWX 的凭证存储支持的明显优势。

环境细节:

  • 可靠的 2.6.4
  • awx 版本 1.0.7.2
  • Ubuntu 18.04.1

谁能看到我做错了什么?

ansible
  • 1 个回答
  • 876 Views
Martin Hope
shaneoh
Asked: 2017-10-03 06:23:39 +0800 CST

安装后没有加载 Rudder UI

  • 0

我正在尝试为 Windows 配置管理测试方向舵。

我在 Virtualbox 的虚拟服务器上执行此操作。主机服务器是 Windows 2012,虚拟服务器是 CentOS 7。

我已按照此处的步骤进行安装,并且似乎已按计划进行 - 安装中没有错误或问题。

但是,当我尝试通过https://192.168.1.10/rudder访问 UI 时,没有加载任何内容 - 只是浏览器中的“响应时间过长”页面。

Rudder 的文档毫无用处,但我已经检查了在主目录中找到的所有日志,以及 apache 等的常规日志,当这些连接失败发生时,我看不到任何日志记录。

有谁知道我在哪里可以从日志中找到像样的信息,对问题可能是什么有任何想法?

rudder
  • 1 个回答
  • 204 Views
Martin Hope
shaneoh
Asked: 2017-08-04 03:58:29 +0800 CST

安装 Windows 的驱动器在 Windows Server 2012 上被锁定

  • 2

长话短说,我相当肯定我们的 Windows 2012 服务器在安装更新时断电,现在我花了大约 30 个小时试图修复它。

我很确定我已经将问题缩小到分区的设置和/或损坏的 BCD 是罪魁祸首,但到目前为止,我在网上找到的任何东西都没有修复它,我发现的任何东西都没有足够清楚地解释需要做什么。

问题的顺序是这样的:

  1. 机器无法启动 - 只有一条错误消息提示需要使用恢复磁盘
  2. 使用恢复盘时,自动修复不起作用(当然)。经过几个小时的尝试,我决定尝试刷新 - 但是,有一条错误消息The drive where Windows is installed is locked. Unlock the drive and try again。
  3. 在线信息表明这可能有几个原因,本文在各个方面总结了所有建议:

https://neosmart.net/wiki/the-drive-where-windows-is-installed-is-locked/

  1. 该页面上的方法 3(使用 chkdsk)不返回任何错误和信息。
  2. 该页面上的方法 4(使用 bootrec)在最终命令 ( bootrec /RebuildBcd) 上失败并显示消息The requested system device cannot be found.
  3. 该页面上的方法 5似乎可以正常工作,但是,机器仍然无法启动并出现相同的问题,并且修复选项仍然不起作用。

我应该指出方法 5 对我来说不清楚 - 例如,其中一个步骤说使用 FAT32 查找分区,但我的没有一个如我所附照片所示。另一个问题是本教程没有解释每个步骤在做什么。我是要从可启动 USB 复制东西吗?我是从一卷复制到另一卷吗?我不知道目标是什么,所以我不知道应该在什么时候使用哪个驱动器号。

在此之后,我尝试sfc /scannow按照以下 snayob 的建议运行,但是当我这样做时,我收到一条消息说There is a system repair pending which requires reboot to complete. Restart Windows and run sfc again.当然,我无法重新启动 Windows。当我重新启动时,我又回到了起点。

我认为我不清楚的是以下问题:

  1. 我需要给每卷特定的指定字母吗?如果是这样,是什么?
  2. 与此相关的是,图像中列为 C 的卷在机器运行时并未称为 C - 我的主卷称为 C,它安装了操作系统(在 diskpart 中列为 D 的那个)。同样,在 diskpart 中列为 E 的那个以前称为 D。
  3. 愚蠢的问题,但我不是 100% 清楚哪个卷是系统卷,尽管我认为它的大小是 350MB。任何人都可以从diskpart信息中分辨出来吗?
  4. 这也是我应该“活跃”的吗?
  5. 总的来说,是否可以准确地告诉我在这里需要做什么?我相信我已经接近让它再次运行,但我也尝试了我能找到的一切。

任何帮助将不胜感激 - 我以前从来没有进入过这个,所以我知道我在最后一天左右学到的一切。

编辑

根据建议,我尝试按照此处的步骤操作。但是,在运行命令时sfc scannow。我得到错误:

There is a system repair pending which requires a reboot to complete. Restart Windows and run sfc again.

当然,我不能那样做。根据文章,我将此命令更改为sfc /scannow /offbootdir=c:\ /offwindir=d:\windows. 这里的输出是:

Resource Protection could not start the repair service.

所以我跑net start trustedinstaller。该命令成功,但是当我运行该sfc /scannow /offbootdir=c:\ /offwindir=d:\windows命令时,我再次收到有关未启动修复服务的消息。

我们现在已经花了一个星期的时间 ​​- 荒谬。我正在和一位管理大量服务器的朋友交谈,他的建议是“扔掉你所有的 Windows 服务器”。他半开玩笑,但我认为我们现在处于这实际上是答案的阶段 - 我会再等一天左右,然后将其作为解决方案发布,因为这是我们必须要做的。

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

windows-server-2012
  • 3 个回答
  • 10129 Views
Martin Hope
shaneoh
Asked: 2017-06-15 23:44:16 +0800 CST

在 nginx 中更改服务器名称会导致失败

  • 0

我正在运行一个 Web 应用程序的安装,该应用程序使用 nginx 作为其 HTTPS 和 apache 来提供内容。

我刚刚在新机器上完成了升级版本的安装,但我遇到了一个奇怪的问题。

当我使用 URL newapplication.mydomaincom 时,一切都很好。但是,当我尝试通过将所有内容切换到 application.mydomain.com 来上线时,它不起作用 - 我只是得到测试“欢迎使用 nginx!” 页。

我的 application.conf 文件在下面,请注意,如果我将“application.mydomain.com”的每个实例都更改为“newapplication.mydomain.com”,那么它工作得很好——我可以在浏览器中输入“newapplication.mydomain.com”并被重定向到 HTTPS。但是,当使用“application.mydomain.com”时,它会失败。我可以输入“application.mydomain.com:18804”,这有效(根据我的 apache 配置)。

Nginx 配置文件:

    upstream application {

            server 127.0.0.1:18805;

    }


    server {

            listen 18804;

            location / {

                    return 301 https://$host$request_uri;

            }

    }




    server {

            listen 80;

            location / {

                    return 301 https://$host$request_uri;

            }

    }



    server {

            listen 443 ssl;

            server_name application.mydomain.com;

            access_log /var/log/nginx/application.access.log;

            error_log /var/log/nginx/application-errors.log;

            ssl on;

            ssl_certificate_key /etc/ssl/private/my.key;

            ssl_certificate /etc/ssl/certs/my.crt;

            ssl_ciphers RC4:HIGH:!aNULL:!MD5;

            ssl_prefer_server_ciphers on;


            client_max_body_size 0;



            location / {

                    proxy_set_header Host $host;

                    proxy_set_header X-Real-IP $remote_addr;

                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                    proxy_pass http://redmine;

            }

    }

    server {
        listen 18804;
        server_name application.mydomain.com;

        return 301 https://application.mydomain.com$uri;
    }

    server {
        listen 80;
        server_name application.mydomain.com;

        return 301 https://application.mydomain$uri;
}

阿帕奇配置:

<VirtualHost *:18805>
  DocumentRoot /var/www/html/application/public
  ServerName application.mydomain.com
  ServerAlias 127.0.0.1
  ErrorDocument 503 /maintenance.html
  RewriteEngine on
  RewriteCond %{DOCUMENT_ROOT}/../tmp/stop.txt -f
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ /$1 [R=503,L]

<Directory /var/www/html/application/public/>
  AllowOverride all
  # MultiViews must be turned off.
  Options -MultiViews
</Directory>

  ErrorLog logs/application_3.3.3_log

</VirtualHost>

谁能看到我做错了什么?我很困惑,简单地更改服务器名称就是这样做的。

nginx
  • 1 个回答
  • 35 Views
Martin Hope
shaneoh
Asked: 2017-01-04 08:08:13 +0800 CST

使用 Jenkins DSL 在 github scm 节点中指定一个 Git 可执行文件

  • 1

我正在将一些 Jenkins 工作转换为 DSL 脚本。

其中一些将 github 用于 SCM,并且由于 DSL 支持这一点,因此配置起来很容易。然而,在 100 多次作业转换之后,我第一次需要指定一个 Git 可执行文件(到目前为止所有作业都使用默认值)并且似乎没有办法做到这一点。job.xml 显示了这一点:

<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<configVersion>2</configVersion>
<userRemoteConfigs>...</userRemoteConfigs>
<branches>...</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<gitTool>Ubuntu Git</gitTool>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.SparseCheckoutPaths>
<sparseCheckoutPaths>
<hudson.plugins.git.extensions.impl.SparseCheckoutPath>
<path>
octane.pricing/octane.trader/server/work/mif_interface/cfg
</path>
</hudson.plugins.git.extensions.impl.SparseCheckoutPath>
</sparseCheckoutPaths>
</hudson.plugins.git.extensions.impl.SparseCheckoutPaths>
</extensions>
</scm>

除了<gitTool>Ubuntu Git</gitTool>.

这在 DSL 中没有提到,所以我认为这不受支持,所以我尝试使用 configure 块(请记住,我仍在学习如何使用它)。尝试了一些事情,但我最期望的工作:

  configure { project ->
    project << 'hudson.plugins.git.GitSCM' {
      paramDefs << 'gitTool' {
        string('Ubuntu Git')
        }
     }
  }

但没有骰子 - XML 仍然显示“默认”选项。

我很惊讶这不能直接在 DSL 中指定,但是任何人都可以看到我在配置块中做错了什么吗?

jenkins
  • 1 个回答
  • 583 Views
Martin Hope
shaneoh
Asked: 2016-12-30 00:28:08 +0800 CST

如何将 Jenkins Git 插件从使用 GIT_ASKPASS 更改为 .gitcredentials

  • 2

我已经发布了这个问题:

Jenkins 升级到 Git 客户端插件 2.1.0 后无法读取 Github 密码

简而言之,我已经克隆了 Jenkins 1.650 的生产实例,并在 Windows 2012 上将克隆的实例升级到了 2.25。

作为其中的一部分,Git Client 插件已从 1.19.6 升级到 2.1.0,现在它无法进行身份验证。

如果我再次降级此插件,我的作业可以完美运行,但是当使用升级的插件运行它们时,作业会失败。

我现在注意到我可以看到的一个区别是,在作业输出中,在它工作的实例上有一条消息using .gitcredentials to set credentials,而在克隆的实例上using GIT_ASKPASS to set credentials。

我怀疑这是问题所在,或者至少是相关的,但我找不到改变它的方法。以下失败作业的完整输出:

08:18:40 Cloning the remote Git repository
08:18:40 Cloning repository https://github.com/mycompany/myrepo.git
08:18:40  > C:\Program Files\Git\cmd\git.exe init C:\Program Files (x86)\Jenkins\workspace\project # timeout=10
08:18:40 Fetching upstream changes from https://github.com/mycompany/myrepo.git
08:18:40  > C:\Program Files\Git\cmd\git.exe --version # timeout=10
08:18:40 using GIT_ASKPASS to set credentials 
08:18:40  > C:\Program Files\Git\cmd\git.exe fetch --tags --progress https://github.com/mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*
08:18:41 ERROR: Error cloning remote repo 'origin'
08:18:41 hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe fetch --tags --progress https://github.com/mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
08:18:41 stdout: 
08:18:41 stderr: '*dds23' is not recognized as an internal or external command,
08:18:41 operable program or batch file.
08:18:41 error: unable to read askpass response from 'C:\Windows\TEMP\pass6274847349411211542.bat'
08:18:41 bash: /dev/tty: No such device or address
08:18:41 error: failed to execute prompt script (exit code 1)
08:18:41 fatal: could not read Password for 'https://[email protected]': No error
08:18:41 
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
08:18:41    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1054)
08:18:41    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
08:18:41    at hudson.scm.SCM.checkout(SCM.java:495)
08:18:41    at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
08:18:41    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
08:18:41    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
08:18:41    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
08:18:41    at hudson.model.Run.execute(Run.java:1720)
08:18:41    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
08:18:41    at hudson.model.ResourceController.execute(ResourceController.java:98)
08:18:41    at hudson.model.Executor.run(Executor.java:401)
08:18:41 ERROR: null
08:18:41 Archiving artifacts
08:18:41 [htmlpublisher] Archiving HTML reports...
08:18:41 [htmlpublisher] Archiving at PROJECT level C:\Program Files (x86)\Jenkins\workspace\project\server.project\server.distribution\target\htmldocs\documentation to C:\Program Files (x86)\Jenkins\jobs\project\htmlreports\documentation
08:18:41 ERROR: Specified HTML directory 'C:\Program Files (x86)\Jenkins\workspace\project\server.project\server.distribution\target\htmldocs\documentation' does not exist.
08:18:41 [BFA] Scanning build for known causes...
08:18:41 [BFA] No failure causes found
08:18:41 [BFA] Done. 0s
08:18:41 Started calculate disk usage of build
08:18:41 Finished Calculation of disk usage of build in 0 seconds
08:18:41 Started calculate disk usage of workspace
08:18:41 Finished Calculation of disk usage of workspace in 0 seconds
08:18:42 Sending e-mails to: bob@yeah
08:18:43 Finished: FAILURE

编辑

根据鲍勃的建议,我已经成功运行了这些命令。

del c:\users\user-name\.gitconfig
git config --global credential.helper manager
git fetch --tags --progress https://stash/myproj/proj.git +refs/heads/*:refs/remotes/origin/*

但是,运行我的工作时的输出完全相同。仍在使用 GIT_ASKPASS。必须有一种方法可以恢复为 .gitcredentials。

git jenkins windows-server-2012
  • 4 个回答
  • 29365 Views
Martin Hope
shaneoh
Asked: 2016-12-22 01:00:18 +0800 CST

Jenkins 升级到 Git 客户端插件 2.1.0 后无法读取 Github 密码

  • 3

我目前在 Windows 2012 上使用 Jenkins 1.650,并且我已将 Jenkins 的测试实例(从我的生产服务器克隆)升级到 2.25。

作为其中的一部分,Git Client 插件已从 1.19.6 升级到 2.1.0,现在它无法进行身份验证。

如果我再次降级此插件,我的作业可以完美运行,但是当使用升级的插件运行它们时,作业会失败。所有的错误输出都是一样的:

08:18:40 Cloning the remote Git repository
08:18:40 Cloning repository https://github.com/mycompany/myrepo.git
08:18:40  > C:\Program Files\Git\cmd\git.exe init C:\Program Files (x86)\Jenkins\workspace\project # timeout=10
08:18:40 Fetching upstream changes from https://github.com/mycompany/myrepo.git
08:18:40  > C:\Program Files\Git\cmd\git.exe --version # timeout=10
08:18:40 using GIT_ASKPASS to set credentials 
08:18:40  > C:\Program Files\Git\cmd\git.exe fetch --tags --progress https://github.com/mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*
08:18:41 ERROR: Error cloning remote repo 'origin'
08:18:41 hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe fetch --tags --progress https://github.com/mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
08:18:41 stdout: 
08:18:41 stderr: '*dds23' is not recognized as an internal or external command,
08:18:41 operable program or batch file.
08:18:41 error: unable to read askpass response from 'C:\Windows\TEMP\pass6274847349411211542.bat'
08:18:41 bash: /dev/tty: No such device or address
08:18:41 error: failed to execute prompt script (exit code 1)
08:18:41 fatal: could not read Password for 'https://[email protected]': No error
08:18:41 
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
08:18:41    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
08:18:41    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1054)
08:18:41    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
08:18:41    at hudson.scm.SCM.checkout(SCM.java:495)
08:18:41    at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
08:18:41    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
08:18:41    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
08:18:41    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
08:18:41    at hudson.model.Run.execute(Run.java:1720)
08:18:41    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
08:18:41    at hudson.model.ResourceController.execute(ResourceController.java:98)
08:18:41    at hudson.model.Executor.run(Executor.java:401)
08:18:41 ERROR: null
08:18:41 Archiving artifacts
08:18:41 [htmlpublisher] Archiving HTML reports...
08:18:41 [htmlpublisher] Archiving at PROJECT level C:\Program Files (x86)\Jenkins\workspace\project\server.project\server.distribution\target\htmldocs\documentation to C:\Program Files (x86)\Jenkins\jobs\project\htmlreports\documentation
08:18:41 ERROR: Specified HTML directory 'C:\Program Files (x86)\Jenkins\workspace\project\server.project\server.distribution\target\htmldocs\documentation' does not exist.
08:18:41 [BFA] Scanning build for known causes...
08:18:41 [BFA] No failure causes found
08:18:41 [BFA] Done. 0s
08:18:41 Started calculate disk usage of build
08:18:41 Finished Calculation of disk usage of build in 0 seconds
08:18:41 Started calculate disk usage of workspace
08:18:41 Finished Calculation of disk usage of workspace in 0 seconds
08:18:42 Sending e-mails to: bob@yeah
08:18:43 Finished: FAILURE

不知道这个插件发生了什么变化突然导致这个失败。

git jenkins github windows-server-2012
  • 1 个回答
  • 1687 Views
Martin Hope
shaneoh
Asked: 2016-11-02 04:35:48 +0800 CST

D-Link 托管交换机是否会导致 LAN 上的客户端出现间歇性连接/DHCP 问题

  • 1

我使用 Draytek 2860 路由器来管理办公室的互联网连接。这将 WAN 连接馈送到托管交换机 (D-Link DGS 1210 24),然后将交换机上的端口连接到基本交换机,然后将服务器连接到办公室周围的多个端口。

我们经常遇到 LAN 连接的连接问题,尽管 Internet 连接良好且无线连接不受影响,但这些连接会中断。从路由器断开并重新连接任何以太网电缆可以解决这些问题,禁用和启用特定客户端上的 LAN 卡也是如此。

在 Draytek 论坛上的讨论使我得出结论,我们网络中的某些东西试图在我不知情的情况下提供 IP 地址,这似乎是最有可能的罪魁祸首,特别是因为我不知道交换机是被管理的并且我访问了 UI今天第一次。但是,它似乎处于默认模式,即几乎所有功能都被禁用。

这是否可能导致问题,任何人都可以建议可以检查以确保不是的设置?现在完全移除交换机会有问题,因为我没有一个简单的可以替换它,而且我们需要办公室中的各种端口。

本质上,我希望这个交换机只为我提供为多个端口供电的能力。我不需要交换机的其他任何东西。确认这是我得到的最好方法是什么?

编辑

根据下面 Bryan Cerrati 的建议,我安装了 Wireshark。但是,每当我将设备连接到网络时,我都可以看到 DHCPRequest 事务,但没有相应的 DHCPOffer(尽管客户端确实连接成功)。我需要的信息是否位于请求中?

在此处输入图像描述

d-link dhcp ip draytek
  • 2 个回答
  • 1077 Views
Martin Hope
shaneoh
Asked: 2016-05-17 01:53:42 +0800 CST

在 openLDAP 中使用 Lets Encrypt 证书

  • 7

我已经运行了几个月的 openLDAP 服务器,我们使用它来对许多应用程序进行身份验证。以前的工作人员设置了服务器,它似乎不是标准安装,但它非常简单。

最近我们的一个 CA 证书过期了,我们决定用 Let's Encrypt 替换它。我的经理更换了服务器上的证书。

它适用于 Web 应用程序(LDAP 管理器、自助服务密码更改),但是没有客户端可以针对它进行身份验证。例如,如果我尝试测试 Redmine LDAP 配置,我会收到一条消息“无法连接(SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A)”

针对它测试 Nexus 身份验证只是无法连接。

令人沮丧的是,LDAP 服务器或应用程序的日志中没有任何内容表明失败的原因。我的调查使我相信这是如何配置证书/密钥的事情,但我已经尝试了我能想到的所有东西以及我可以在网上找到的所有东西,但没有任何效果。

环境细节是:

Debian 8 openLDAP openldap-2.4.40

我的配置如下:

/etc/ldap/ldap.conf

# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
#BASE   dc=example,dc=com
#URI    ldap://ldap.example.com ldap://ldap-master.example.com:666
#SIZELIMIT      12
#TIMELIMIT      15
#DEREF          never
# TLS certificates (needed for GnuTLS)
TLS_CACERT      /etc/letsencrypt/live/myserver.com/fullchain.pem

/etc/ldap/slapd.d/cn=config.ldif

dn: cn=config
objectClass: olcGlobal
cn: config
olcArgsFile: /var/run/slapd/slapd.args
olcLogLevel: none
olcPidFile: /var/run/slapd/slapd.pid
olcToolThreads: 1
structuralObjectClass: olcGlobal
entryUUID: c6dd9e40-9dc2-1035-8c03-add74f928a5e
creatorsName: cn=config
createTimestamp: 20160423171552Z
entryCSN: 20160423171552.629347Z#000000#000#000000
modifiersName: cn=config
modifyTimestamp: 20160423171552Z

如果我测试连接:

admin@ldap:~$ sudo openssl s_client -connect localhost:636 -showcerts -state -CAfile /etc/letsencrypt/live/myserver.com/fullchain.pem
CONNECTED(00000003)
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
140394818631312:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:184:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 289 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE

有谁知道我错过了什么?

编辑

根据@84104 的建议,我将 tls.ldif 文件编辑为如下所示:

dn: cn=config
changetype: modify
replace: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/letsencrypt/live/myserver/fullchain.pem
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/letsencrypt/live/myserver/cert.pem
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/letsencrypt/live/myserver/privkey.pem

然后运行命令:

ldapmodify -Y EXTERNAL -H ldapi:/// -f tls.ldif

但是我现在得到的输出是:

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"
ldap_modify: Other (e.g., implementation specific) error (80)

我发现这可能是由于证书或密钥文件的权限造成的,但我将它们更改为与以前使用的文件上的完全匹配,但仍然收到此消息。

我再次为我缺乏对该主题的一般知识而道歉,但任何人都可以提出其他建议吗?

编辑

根据建议,我更改了 tls.ldif 并将所有命令从替换更改为删除,然后再次运行 ldapmodify 命令。还有另一个错误。

    admin@ldap:/etc/ansible_ldif_work$ sudo ldapmodify -Y EXTERNAL -H   ldapi:/// -f tls.remove.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"
ldap_modify: Inappropriate matching (18)
        additional info: modify/delete: olcTLSCACertificateFile: no equality matching rule
ldap openldap ssl-certificate lets-encrypt
  • 9 个回答
  • 19065 Views
Martin Hope
shaneoh
Asked: 2015-09-19 00:42:31 +0800 CST

在 openVPN 上通过 MAC 地址分配静态 IP

  • 5

我们的企业目前正在我们自己托管的服务器上使用 OpenVPN 运行 VPN。

在此处输入图像描述

出于客户原因,我们需要锁定我们的内部网络 - 所以期望的结果是只有列入白名单的硬件/MAC 地址才能通过我们的 Draytek 2925 路由器连接到我们的网络。这很简单——我们可以简单地使用路由器的严格绑定特性来防止随机连接。但是,我想不出一种方法来使这项工作与 OpenVPN 一起工作。我突然想到我们可以为 VPN 客户端分配静态 IP 地址,但从我在网上可以找到的内容来看,这些只能分配给用户帐户,而不是 MAC 地址。

除此之外,即使我能找到一种分配静态 IP 的方法,我也不确定如何让这些在白名单中发挥作用——目前,如果我尝试在白名单中输入像 10.8.0.2 这样的普通 OpenVPN 地址,路由器告诉我这超出了路由器 LAN 地址范围(大概我可以以某种方式添加它,但我还没有弄清楚如何添加)。

我对所有这些东西都是新手,如果我的问题被认为有点落后于八球,我深表歉意。

如果有人可以帮助解决 MAC 问题,我将不胜感激;或者,如果有人对实现最终目标有更好的想法,我也会很感激。

干杯。

openvpn
  • 1 个回答
  • 2928 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve