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-162443

x-yuri's questions

Martin Hope
x-yuri
Asked: 2024-04-11 12:12:00 +0800 CST

如何使用 GCP 上的网桥替换主网络接口?

  • 5

我想做的是在 GCP 上(在 GCE 虚拟机中)启动桥接OpenVPN 服务器。对我来说,至关重要的部分就在标题中。如果我成功了,剩下的事情就很简单了。我尝试了两种方法:

  • Arch Linux 的方式……iproute2实际上就是这样。我在 Arch Linux 论坛上问过这个问题。细节是要点。
  • OpenVPN 的方式……bridge-utils实际上就是这样。基于官方 howto中的脚本。细节是要点。

看起来不可能在 GCP 上做到这一点,或者我错过了什么?是哪一个?或者我可以做什么来进一步调查这个问题?

vpn
  • 2 个回答
  • 179 Views
Martin Hope
x-yuri
Asked: 2024-04-05 00:03:18 +0800 CST

haproxy 似乎没有看到所有后端/副本

  • 5

我正在尝试haproxy向多个副本发出代理请求:

docker-compose.yml:

services:
  haproxy:
    image: haproxy:2.3-alpine
    volumes:
      - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
    ports:
      - 8888:80
  app:
    build: .
    command: perl app.pl
    init: true
    deploy:
      replicas: 10

haproxy.cfg:

global
    maxconn  1024
listen in
    bind :80
    server-template srv 10 app:8080 check
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms

但似乎只看到了一些复制品:

$ docker compose up
...
app-3      | MyWebServer: You can connect to your server at http://localhost:8080/
haproxy-1  | [NOTICE] 094/155107 (1) : New worker #1 (8) forked
app-4      | MyWebServer: You can connect to your server at http://localhost:8080/
app-2      | MyWebServer: You can connect to your server at http://localhost:8080/
app-5      | MyWebServer: You can connect to your server at http://localhost:8080/
app-9      | MyWebServer: You can connect to your server at http://localhost:8080/
app-7      | MyWebServer: You can connect to your server at http://localhost:8080/
app-6      | MyWebServer: You can connect to your server at http://localhost:8080/
app-1      | MyWebServer: You can connect to your server at http://localhost:8080/
app-10     | MyWebServer: You can connect to your server at http://localhost:8080/
app-8      | MyWebServer: You can connect to your server at http://localhost:8080/
app-3      | d3757cd065b4
app-3      | d3757cd065b4
app-3      | d3757cd065b4
app-4      | 226419df4354
app-4      | 226419df4354
app-4      | 226419df4354
...

更多详细信息请参见此处。

我缺少什么?

docker
  • 1 个回答
  • 41 Views
Martin Hope
x-yuri
Asked: 2023-10-07 08:45:39 +0800 CST

非 MX 邮件服务器 + Google Workspace,这可行吗?

  • 5

我配置了一个域名 (example.com),用于使用 Google Workspace 发送和接收邮件。我需要另外启动一个单独的(自己的)邮件服务器。完全切换到新服务器是不可取的。我们的想法是在 Google Workspace 中拥有一些邮件帐户,并在新服务器上拥有一些邮件帐户。

自然的解决方案可能是使用子域 (1)。example.com 没有任何变化。我只需启动一个邮件服务器并将其链接到例如 email.example.com。

但还有另一个想法令我印象深刻 (2)。保留指向 Google Workspace 的 MX 记录,但更改 SPF,让新服务器使用同一网域 (example.com) 发送邮件。好吧,然后我想到没有办法共享 DKIM 的私钥,是吗?

如果我无法配置 DKIM...我不喜欢它带我去的地方。你怎么认为?这是一个值得尝试的解决方案,还是一个死胡同?

有什么缺点?第一个是 DKIM。另外,我不确定如果我通过新服务器(使用新服务器的帐户)发送电子邮件并且用户回复会发生什么。是否会返回到新服务器或 Google Workspace(考虑到我不想使用子域名)?我猜是后者。这是我能想到的两个缺点。

至于专业人士...不需要引入子域:)好吧,我知道,听起来不太吸引人。但这就是我所拥有的一切。

另外我想知道有人尝试过吗?我不认为我是第一个提出这个想法的人。我希望人们在垃圾邮件还不普遍的时候这样做。(我想曾经有过这样的时刻。)但现在……可能不会了。如果它们是 2 台自己的服务器(没有 Google Workspace),那么我想可以共享 DKIM 的私钥,然后它看起来像是一个选项。不然……可能就不是了。

你怎么认为?

email
  • 2 个回答
  • 65 Views
Martin Hope
x-yuri
Asked: 2023-10-04 20:50:58 +0800 CST

HELO、MAILFROM 和 From 应该使用相同的域吗?

  • 5

我之前配置过邮件服务器几次,我相信当时我认为答案是“是”。

但我正要配置另一台,看来我错了。假设顶级域 ( example.com) 和(唯一的)MX 记录指向同一服务器 ( mail.example.com)。然后我可以做:

  • example.com指向服务器 IP ( aa.aaa.aa.aaa) 并将其返回 (PTR) 到example.com
  • 邮件服务器 ( postfix, exim, ...) 响应example.com( HELO, MAILFROM)

那么 SPF、DKIM 和 DMARC 记录名称为:@、mail._domainkey(如果选择器为mail)和_dmarc。或者简单地说:

@  A  aa.aaa.aa.aaa
@  MX  10  mail
mail  A  aa.aaa.aa.aaa
aa.aaa.aa.aaa  PTR  @

@  TXT  (SPF)
mail._domainkey  TXT  (DKIM)
_dmarc  TXT  (DMARC)

但是如果我有 2 条 MX 记录(mail1和mail2)怎么办?那么我就不能example.com指向 2 个不同的 IP 并将它们指向example.com,可以吗?但即使我可以,我也可以看到 Gmail 不gmail.com使用HELO, MAILFROM。每个服务器用自己的名称响应似乎更明智,不是吗?但那又怎么样,我应该有 2 条 SPF 记录吗?毕竟:

当前版本的 SPF(称为 SPFv1 或 SPF Classic)可保护信封发件人地址

http://www.open-spf.org/Introduction/

@  A  (whatever)

@  MX  10  mail1
mail1  A  aa.aaa.aa.aaa
aa.aaa.aa.aaa  PTR  mail1

@  MX  20  mail2
mail2  A  bb.bbb.bb.bbb
bb.bbb.bb.bbb  PTR  mail2

mail1  TXT  (SPF)
mail2  TXT  (SPF)
mail._domainkey  TXT  (DKIM)
_dmarc  TXT  (DMARC)

坦白说,在阅读有关配置邮件服务器的不同文章和答案后,我感到很困惑。什么是正确或更好的设置?

email
  • 1 个回答
  • 52 Views
Martin Hope
x-yuri
Asked: 2023-08-30 19:22:19 +0800 CST

如何配置 SSL/TLS 以连接到 Cloud SQL 实例?

  • 5

据我所知,Cloud SQL 始终可以通过 SSL/TLS 连接。如果我强制执行它,它就成为必需的。但我能够达到的最大保护级别是verify-ca从客户端和服务器的角度来看的。那是:

  • 服务器不会确保 ( auth-options)客户端证书中的通用名称与我尝试连接的用户匹配(可以使用任何通用名称)
  • 客户端不会确保服务器证书中的公用名称与我要连接的主机名匹配(可以使用任何主机名)

根据我可以连接的文档sslmode=verify-full,但要么我不知道它们的实例名称是什么意思,要么文档中的信息已过时。(1) 如何连接verify-full?

文档还说:

verify-full不需要SSL 模式;verify-ca就足够了,因为 CA 是特定于实例的。

在文档pg中我可以看到:

verify-ca和之间的差异verify-full取决于根 CA 的策略。如果使用公共 CA,verify-ca则允许连接到其他人可能已向该 CA 注册的服务器。在这种情况下,verify-full应始终使用。如果使用本地 CA,甚至是自签名证书,verify-ca通常可以提供足够的保护。

(2)这是什么意思?如果CA是本地的,那么只有授权的人才能创建证书和私钥,并用CA的根证书签署证书?虽然人们可能可以获得服务器的证书(如果服务器是公共的),但是却无法获得私钥?那么,未经授权的人就不能拥有有效的证书吗?因此,如果证书有效,则它是由授权人员创建的,CN 是什么并不重要?为什么?看起来我已经很接近了,但仍然缺少一些东西。

(3) 如果CA是本地的,verify-ca== verify-full(无窃听,无MITM)?

关于我到底做了什么的更多细节可以在这里找到。

ssl
  • 1 个回答
  • 36 Views
Martin Hope
x-yuri
Asked: 2023-08-18 10:06:39 +0800 CST

通过 Cloud SQL Auth 代理连接时是否需要密码?

  • 5

看来这是必要的,因为它要求我输入密码。但如果是这样,那么拥有 2 个凭据(凭据文件 + 密码)有什么意义呢?

如果没有,那我错过了什么?

文档对此并没有透露太多:

如果出现提示,请输入密码。

为了从本地机器上测试它,我做了:

docker-compose.yml:

services:
  app:
    build: .
    command: sleep infinity
    init: true
    volumes:
      - .:/app
    depends_on:
      - proxy

  proxy:
    image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.6.0
    command:
      --address 0.0.0.0
      --credentials-file /credentials.json
      --debug
      myprj:europe-central2:db
    volumes:
      - ./credentials.json:/credentials.json

Dockerfile:

FROM google/cloud-sdk:435.0.1-alpine
RUN apk add terraform postgresql15-client
WORKDIR /app

main.tf:

provider "google" {
  project = "myprj"
}

resource "google_sql_database_instance" "test-auth" {
  deletion_protection = false
  name = "db"
  region = "europe-central2"
  database_version = "POSTGRES_11"
  settings {
    tier = "db-f1-micro"
  }
}

resource "google_sql_user" "test-auth" {
  name = "postgres"
  instance = google_sql_database_instance.test-auth.name
  password = 123456
}

resource "google_service_account" "test-auth" {
  account_id = "dbaccount"
}

resource "google_project_iam_member" "test-auth" {
  project = "myprj"
  role    = "roles/cloudsql.client"
  member  = "serviceAccount:${google_service_account.test-auth.email}"
}
$ gcloud auth application-default login
$ terraform init
$ terraform apply
// create the service account key, copy to ./credentials.json, restart the container
$ psql -h proxy -U postgres
google-cloud-platform
  • 1 个回答
  • 61 Views
Martin Hope
x-yuri
Asked: 2022-01-20 08:29:45 +0800 CST

EC2 实例的停机时间

  • 0

最近我在 EC2 实例上遇到了问题。在那里运行的站点在 2 小时内不可用:

过去一周的 CPU 利用率:

其余的都在它发生的时候:

那个时期的systemd杂志。

我在那里能看到什么?在 20:31 左右,事情似乎变得缓慢:

计划在 20:30 的每分钟作业的作业执行延迟到下一分钟的 20:31。跳过作业运行。

作业 ( cronyd) 无法启动。

Jan 12 21:31:29 ip-172-xx-x-xx.xx-yy-z.compute.internal chronyd[24287]: Forward time jump detected!
Jan 12 21:33:21 ip-172-xx-x-xx.xx-yy-z.compute.internal chronyd[24287]: Can't synchronise: no selectable sources

台词,通常是连在一起的dhclient,但在那个时期是这样的:

Jan 12 20:46:21 ip-172-xx-x-xx.xx-yy-z.compute.internal dhclient[3066]: DHCPREQUEST on eth0 to 172.xx.x.xx port 67 (xid=0x7cb0e02d)
Jan 12 20:46:22 ip-172-xx-x-xx.xx-yy-z.compute.internal dhclient[3066]: DHCPACK from 172.xx.x.xx (xid=0x7cb0e02d)
Jan 12 21:06:23 ip-172-xx-x-xx.xx-yy-z.compute.internal dhclient[3066]: bound to 172.yy.y.yy -- renewal in 354 seconds.

还:

Jan 12 21:47:22 ip-172-xx-x-xx.xx-yy-z.compute.internal dhclient[3066]: bound to 172.yy.y.yy -- renewal in -554 seconds.

看起来在 21:47 一切恢复正常。

在那里运行的docker容器重新启动。我记得他们的日志开始于接近晚上 10 点,可能是在 21:47。

sysstat日志()/var/log/sa/sar12:

07:00:01 PM     all      3.77      0.00      0.53      0.00      0.53      0.00      0.11      0.00      0.00     95.05
07:00:01 PM       0      4.22      0.00      0.54      0.01      0.45      0.00      0.11      0.00      0.00     94.68
07:00:01 PM       1      3.33      0.00      0.53      0.00      0.61      0.00      0.10      0.00      0.00     95.43
07:10:01 PM     all      3.47      0.00      0.52      0.00      0.54      0.00      0.13      0.00      0.00     95.34
07:10:01 PM       0      4.01      0.00      0.53      0.00      0.48      0.00      0.10      0.00      0.00     94.88
07:10:01 PM       1      2.93      0.00      0.52      0.01      0.60      0.00      0.15      0.00      0.00     95.80
07:20:01 PM     all      1.89      0.00      0.47      0.00      0.46      0.00      0.10      0.00      0.00     97.08
07:20:01 PM       0      1.54      0.00      0.46      0.00      0.39      0.00      0.10      0.00      0.00     97.50
07:20:01 PM       1      2.24      0.00      0.48      0.00      0.53      0.00      0.10      0.00      0.00     96.65
07:30:01 PM     all      1.37      0.00      0.47      0.00      0.42      0.00      0.09      0.00      0.00     97.65
07:30:01 PM       0      1.55      0.00      0.46      0.00      0.36      0.00      0.08      0.00      0.00     97.54
07:30:01 PM       1      1.18      0.00      0.48      0.00      0.47      0.00      0.10      0.00      0.00     97.77
07:40:01 PM     all      1.32      0.00      0.47      0.00      0.41      0.00      0.10      0.00      0.00     97.71
07:40:01 PM       0      1.46      0.00      0.46      0.00      0.33      0.00      0.09      0.00      0.00     97.66
07:40:01 PM       1      1.18      0.00      0.47      0.00      0.48      0.00      0.10      0.00      0.00     97.77
07:50:01 PM     all      1.36      0.00      0.48      0.00      0.41      0.00      0.10      0.00      0.00     97.65
07:50:01 PM       0      1.14      0.00      0.45      0.00      0.33      0.00      0.11      0.00      0.00     97.96
07:50:01 PM       1      1.58      0.00      0.50      0.00      0.50      0.00      0.09      0.00      0.00     97.33
08:00:01 PM     all      2.17      0.00      0.52      0.01      0.52      0.00      0.12      0.00      0.00     96.66
08:00:01 PM       0      2.26      0.00      0.49      0.01      0.45      0.00      0.13      0.00      0.00     96.67
08:00:01 PM       1      2.08      0.00      0.55      0.01      0.60      0.00      0.12      0.00      0.00     96.65
08:10:01 PM     all      3.47      1.35      2.41      0.08      0.58      0.00      0.15      0.00      0.00     91.96
08:10:01 PM       0      3.28      1.11      2.38      0.07      0.50      0.00      0.15      0.00      0.00     92.51
08:10:01 PM       1      3.66      1.58      2.45      0.09      0.66      0.00      0.15      0.00      0.00     91.40

08:10:01 PM     CPU      %usr     %nice      %sys   %iowait    %steal      %irq     %soft    %guest    %gnice     %idle
08:20:01 PM     all      1.73      0.00      0.54      0.07      0.48      0.00      0.10      0.00      0.00     97.07
08:20:01 PM       0      1.94      0.00      0.58      0.07      0.40      0.00      0.10      0.00      0.00     96.90
08:20:01 PM       1      1.52      0.00      0.51      0.08      0.55      0.00      0.11      0.00      0.00     97.23
09:50:02 PM     all      2.11      0.11     50.63     43.63      0.09      0.00      0.02      0.00      0.00      3.41
09:50:02 PM       0      3.34      0.09     15.85     77.19      0.07      0.00      0.02      0.00      0.00      3.45
09:50:02 PM       1      0.93      0.12     83.90     11.54      0.11      0.00      0.02      0.00      0.00      3.37
10:00:01 PM     all      2.11      0.00      0.43      2.61      0.35      0.00      0.07      0.00      0.00     94.42
10:00:01 PM       0      1.87      0.00      0.45      2.73      0.25      0.00      0.07      0.00      0.00     94.63
10:00:01 PM       1      2.36      0.00      0.42      2.50      0.45      0.00      0.07      0.00      0.00     94.20
10:10:01 PM     all      0.80      0.00      0.33      0.00      0.29      0.00      0.06      0.00      0.00     98.52
10:10:01 PM       0      0.82      0.00      0.31      0.00      0.20      0.00      0.07      0.00      0.00     98.59
10:10:01 PM       1      0.77      0.00      0.35      0.00      0.37      0.00      0.06      0.00      0.00     98.45
10:20:01 PM     all      0.85      0.00      0.35      0.00      0.29      0.00      0.07      0.00      0.00     98.44
10:20:01 PM       0      0.85      0.00      0.34      0.00      0.21      0.00      0.07      0.00      0.00     98.53
10:20:01 PM       1      0.86      0.00      0.36      0.00      0.37      0.00      0.06      0.00      0.00     98.35
10:30:01 PM     all      1.41      0.00      0.38      0.00      0.33      0.00      0.08      0.00      0.00     97.79
10:30:01 PM       0      1.13      0.00      0.36      0.00      0.25      0.00      0.07      0.00      0.00     98.18
10:30:01 PM       1      1.69      0.00      0.40      0.00      0.42      0.00      0.09      0.00      0.00     97.40
10:40:01 PM     all      0.98      0.00      0.35      0.00      0.29      0.00      0.06      0.00      0.00     98.32
10:40:01 PM       0      0.70      0.00      0.33      0.00      0.22      0.00      0.06      0.00      0.00     98.69
10:40:01 PM       1      1.25      0.00      0.36      0.00      0.35      0.00      0.07      0.00      0.00     97.96
10:50:01 PM     all      0.65      0.00      0.34      0.00      0.28      0.00      0.06      0.00      0.00     98.68
10:50:01 PM       0      0.80      0.00      0.34      0.00      0.20      0.00      0.05      0.00      0.00     98.61
10:50:01 PM       1      0.50      0.00      0.34      0.00      0.35      0.00      0.06      0.00      0.00     98.75

8:20 和 9:50 之间有一个间隙,只有在 9:50 我们才能看到负载(空闲 3%)。

这里可能相关的是,在 1 月 4 日,我启用了时间同步 ( timedatectl set-ntp true),因为有 15 分钟的偏移量:

系统时钟错误 -910.996745 秒

这是一个t3a.medium例子。而且我相信那时信用规范是无限的。至少那是我第二天看到的。无论如何,信用余额并没有达到最低点。

你能解释一下吗?我可以检查什么?

公平地说,我不能确定它不是由网站或其组件之一引起的,但我没有遇到过此类问题。

UPD该问题可能是由其中一个容器中的内存泄漏引起的。至少在让它nokogiri在不同的进程中运行任务之后,内存停止增长,到目前为止还没有类似的事件发生。

amazon-ec2
  • 0 个回答
  • 107 Views
Martin Hope
x-yuri
Asked: 2022-01-12 14:07:49 +0800 CST

无法通过 HTTPS 连接到站点 (SSL_ERROR_SYSCALL)

  • 1

我有一台运行 Debian 8 的服务器。是的,一个很旧的服务器。但它确实有一些奇怪的地方。我无法通过 HTTPS 连接到它:

$ curl -sSLv https://example.com
*   Trying xx.yyy.xx.yyy:443...
* Connected to example.com (xx.yyy.xx.yyy) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: none
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to example.com:443 
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to example.com:443 

$ sslscan example.com
Version: 2.0.11
OpenSSL 1.1.1m  14 Dec 2021

Connected to xx.yyy.xx.yyy

Testing SSL server example.com on port 443 using SNI name example.com

  SSL/TLS Protocols:
SSLv2     disabled
SSLv3     disabled
TLSv1.0   disabled
TLSv1.1   disabled
TLSv1.2   disabled
TLSv1.3   disabled

  TLS Fallback SCSV:
Connection failed - unable to determine TLS Fallback SCSV support

  TLS renegotiation:
Session renegotiation not supported

  TLS Compression:
OpenSSL version does not support compression
Rebuild with zlib1g-dev package for zlib support

  Heartbleed:

  Supported Server Cipher(s):
Certificate information cannot be retrieved.

$ dpkg -l | grep openssl
ii  openssl                             1.0.1t-1+deb8u12             amd64        Secure Sockets Layer toolkit - cryptographic utility

$ cat /etc/nginx/nginx.conf | grep ssl
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

$ dpkg -l | grep nginx
ii  nginx                               1.6.2-5                      all          small, powerful, scalable web/proxy server
ii  nginx-common                        1.6.2-5                      all          small, powerful, scalable web/proxy server - common files
ii  nginx-full                          1.6.2-5                      amd64        nginx web/proxy server (standard version)

要将它与另一个 Debian 8 服务器进行比较:

$ sslscan example2.com
Version: 2.0.11
OpenSSL 1.1.1m  14 Dec 2021

Connected to xx.xxx.xx.xxx

Testing SSL server example2.com on port 443 using SNI name example2.com

  SSL/TLS Protocols:
SSLv2     disabled
SSLv3     disabled
TLSv1.0   enabled
TLSv1.1   enabled
TLSv1.2   enabled
TLSv1.3   disabled

  TLS Fallback SCSV:
Server supports TLS Fallback SCSV

  TLS renegotiation:
Secure session renegotiation supported

  TLS Compression:
OpenSSL version does not support compression
Rebuild with zlib1g-dev package for zlib support

  Heartbleed:
TLSv1.2 not vulnerable to heartbleed
TLSv1.1 not vulnerable to heartbleed
TLSv1.0 not vulnerable to heartbleed

  Supported Server Cipher(s):
Preferred TLSv1.2  256 bits  ECDHE-RSA-AES256-GCM-SHA384   Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  ECDHE-RSA-AES256-SHA384       Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  ECDHE-RSA-AES256-SHA          Curve P-256 DHE 256
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-GCM-SHA384     DHE 1024 bits
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-SHA256         DHE 1024 bits
Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-SHA            DHE 1024 bits
Accepted  TLSv1.2  256 bits  DHE-RSA-CAMELLIA256-SHA       DHE 1024 bits
Accepted  TLSv1.2  256 bits  AES256-GCM-SHA384            
Accepted  TLSv1.2  256 bits  AES256-SHA256                
Accepted  TLSv1.2  256 bits  AES256-SHA                   
Accepted  TLSv1.2  256 bits  CAMELLIA256-SHA              
Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-GCM-SHA256   Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-SHA256       Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-SHA          Curve P-256 DHE 256
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-GCM-SHA256     DHE 1024 bits
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-SHA256         DHE 1024 bits
Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-SHA            DHE 1024 bits
Accepted  TLSv1.2  128 bits  DHE-RSA-CAMELLIA128-SHA       DHE 1024 bits
Accepted  TLSv1.2  128 bits  AES128-GCM-SHA256            
Accepted  TLSv1.2  128 bits  AES128-SHA256                
Accepted  TLSv1.2  128 bits  AES128-SHA                   
Accepted  TLSv1.2  128 bits  CAMELLIA128-SHA              
Preferred TLSv1.1  256 bits  ECDHE-RSA-AES256-SHA          Curve P-256 DHE 256
Accepted  TLSv1.1  256 bits  DHE-RSA-AES256-SHA            DHE 1024 bits
Accepted  TLSv1.1  256 bits  DHE-RSA-CAMELLIA256-SHA       DHE 1024 bits
Accepted  TLSv1.1  256 bits  AES256-SHA                   
Accepted  TLSv1.1  256 bits  CAMELLIA256-SHA              
Accepted  TLSv1.1  128 bits  ECDHE-RSA-AES128-SHA          Curve P-256 DHE 256
Accepted  TLSv1.1  128 bits  DHE-RSA-AES128-SHA            DHE 1024 bits
Accepted  TLSv1.1  128 bits  DHE-RSA-CAMELLIA128-SHA       DHE 1024 bits
Accepted  TLSv1.1  128 bits  AES128-SHA                   
Accepted  TLSv1.1  128 bits  CAMELLIA128-SHA              
Preferred TLSv1.0  256 bits  ECDHE-RSA-AES256-SHA          Curve P-256 DHE 256
Accepted  TLSv1.0  256 bits  DHE-RSA-AES256-SHA            DHE 1024 bits
Accepted  TLSv1.0  256 bits  DHE-RSA-CAMELLIA256-SHA       DHE 1024 bits
Accepted  TLSv1.0  256 bits  AES256-SHA                   
Accepted  TLSv1.0  256 bits  CAMELLIA256-SHA              
Accepted  TLSv1.0  128 bits  ECDHE-RSA-AES128-SHA          Curve P-256 DHE 256
Accepted  TLSv1.0  128 bits  DHE-RSA-AES128-SHA            DHE 1024 bits
Accepted  TLSv1.0  128 bits  DHE-RSA-CAMELLIA128-SHA       DHE 1024 bits
Accepted  TLSv1.0  128 bits  AES128-SHA                   
Accepted  TLSv1.0  128 bits  CAMELLIA128-SHA              

  Server Key Exchange Group(s):
TLSv1.2  128 bits  secp256r1 (NIST P-256)

  SSL Certificate:
Signature Algorithm: sha256WithRSAEncryption
RSA Key Strength:    4096

Subject:  example2.com
Altnames: DNS:example2.com
Issuer:   R3

Not valid before: Dec 17 21:00:13 2021 GMT
Not valid after:  Mar 17 21:00:12 2022 GMT

$ dpkg -l | grep openssl
ii  openssl                          1.0.1k-3+deb8u2                                amd64        Secure Sockets Layer toolkit - cryptographic utility

$ cat /etc/nginx/nginx.conf | grep ssl
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

$ dpkg -l | grep nginx
ii  nginx                            1.6.2-5                                        all          small, powerful, scalable web/proxy server
ii  nginx-common                     1.6.2-5                                        all          small, powerful, scalable web/proxy server - common files
ii  nginx-full                       1.6.2-5                                        amd64        nginx web/proxy server (standard version)

第一个服务器有什么问题?如何使 https 工作?

ssl nginx openssl
  • 1 个回答
  • 4343 Views
Martin Hope
x-yuri
Asked: 2019-09-25 08:23:54 +0800 CST

有没有办法找到私有 IP/域指向的位置?

  • 0

我知道给我的那个网站使用了 ElasticSearch。我知道它通过私有 IP(域)连接到 ElasticSearch。我可以在网络接口的 EC2 控制台中看到这个 IP。状态列显示“正在使用”,但没有实例 ID。这是怎么回事?有没有办法找出 ElasticSearch 在哪里运行?我还没有获得对 EC2 实例的 SSH 访问权限。

amazon-web-services
  • 1 个回答
  • 58 Views
Martin Hope
x-yuri
Asked: 2019-07-01 11:14:08 +0800 CST

就物理桥而言,Linux 桥是什么?

  • 0

通常,网桥是将多个网段连接为一个的L2设备。它没有 IP,基本上只是将帧发送到每个段,除了接收它的段(或更智能的段)。

但是使用 Linux 网桥,您会得到一个带有 IP 地址的接口。考虑下图与docker容器:


(来源:docker.com)

在这种情况下,我正在谈论的接口是docker0和my_bridge。

然后,您使用veth对将容器连接到网桥。一veth对的一端由一个接口表示,该接口具有您可以在容器中看到的 IP 地址。另一端没有 IP 地址,属于主机的网络命名空间。你可以在输出中看到master docker0它旁边的东西。ip a可以将一对的这一端视为插入网桥端口的连接器。

此外,我可以172.17.0.0/16 dev docker0 ...在主机的路由表中看到规则,这使得将数据包从主机发送到容器成为可能。

但是我也可以将数据包从容器发送到主机eth0接口。它位于不同的子网中。而且我在输出中看不到主机接口master docker0旁边。无论如何,这可能没有意义,因为网桥无法连接不同的子网。因此,这部分(以及上一段中的部分)可能不能被视为桥梁的一部分。而是作为 Linux 网桥附带的额外行为。eth0ip a

此外,当我将数据包从一个容器发送到另一个容器时,我可以在主机的网络命名空间中看到它们(主机iptables处理它们)。

无论我如何尝试,我都无法用我无法选择的 Linux 网桥来描绘图表。就上图而言,它看起来像是网桥连接了不同的子网,这是物理网桥无法完成的。

我可能宁愿在my_bridge和veth对之间架起桥梁。但是必须承认您将线对的末端veth插入my_bridge,而不是插入桥。桥接器能够将数据包从主机发送到容器,从容器发送到主机eth0接口。

因此,Linux 网桥似乎是一个带有一些额外曲折的网桥。而且你不能在不引入错误的情况下轻松地在图表上描述它,对吗?我对上面的任何事情都错了吗?

docker
  • 1 个回答
  • 370 Views
Martin Hope
x-yuri
Asked: 2019-06-29 07:22:32 +0800 CST

本地连接是否由 iptables 处理?

  • 0

我正在尝试理解iptables由添加的规则docker,但我在这方面的技能远非很强。

我不确定的一件事是,比如说,我已经开始nginx运行,而且我正在运行,curl localhost或者curl ETH0_IP(在同一台主机上)。数据包之间是否流动curl并被nginx处理iptables(可能受规则影响)?

iptables
  • 1 个回答
  • 140 Views
Martin Hope
x-yuri
Asked: 2019-04-01 06:00:11 +0800 CST

debian-keyring 和 debian-archive-keyring 之间的区别?

  • 2

我需要两者都安装软件包吗?每个人的目的是什么?

debian
  • 1 个回答
  • 830 Views
Martin Hope
x-yuri
Asked: 2019-03-31 05:45:17 +0800 CST

MTA 可以通过中继发送邮件而不被告知吗?

  • 5

我正在考虑将 SPF 添加到域中。所以我担心在某些情况下我的 MTA 在发送邮件时会使用一些中继。比如,当目标服务器太忙什么的时候?我主要对postfix' 或exim' 的默认设置感兴趣。

email
  • 3 个回答
  • 526 Views
Martin Hope
x-yuri
Asked: 2019-03-22 06:14:57 +0800 CST

缺少日志轮换

  • 1

我的一台服务器最近空间不足。所以我开始研究它。日志占用了分区的nginx一半。另外,我注意到一件奇怪的事情。对于很多网站(60%)存在额外的旋转(example.com-access.log.53.gz当rotate 52)。大多数最大的——但不是全部——只有两次旋转:

example.com-access.log
example.com-access.log.53.gz

50% 的原木只有这两个轮换。有时旋转中只有孔(30%):一个文件或更多。*.log.1经常失踪(25%)。*.log.1有时两者都有*.log.1.gz(172 个中有 2 个)。

你能解释一下这个缺失/重复的旋转吗?*.log+ *.log.53.gzcase 让我觉得在某些时候它无法旋转*.log.1到*.log.2.gz. 但是不成功后不会停止gzip吗?那么一定没有孔。或者至少必须*.log.1存在,如果它不存在,不是吗?

如果有的话,我正在运行 Debian 服务器。

/etc/logrotate.conf:

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here

/etc/logrotate.d/nginx:

/var/log/nginx/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 0640 www-data adm
    size 50M
    sharedscripts
    prerotate
        if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
            run-parts /etc/logrotate.d/httpd-prerotate; \
        fi \
    endscript
    postrotate
        [ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`
    endscript
}

/etc/logrotate.d/httpd-prerotate不存在。

linux
  • 1 个回答
  • 1320 Views
Martin Hope
x-yuri
Asked: 2018-03-15 11:52:30 +0800 CST

systemd-timesyncd 是否需要监听随机 UDP 端口才能正常工作?

  • 1

在 Debian Jessie 服务器上,我看到systemd-timesyncd监听随机 UDP 端口。在 Debian Stretch 主机上并非如此。随机我的意思是它侦听的端口因服务器而异。是否需要监听 UDP 端口才能正常工作?我想阻止不需要的端口。这是否意味着我必须打开所有 UDP 端口?

debian
  • 1 个回答
  • 1299 Views
Martin Hope
x-yuri
Asked: 2017-06-15 06:05:07 +0800 CST

有没有办法在 lxc 配置中为接口指定名称服务器?

  • 2

我正在尝试让 LXC 容器使用静态 IP 地址。为此我指定

lxc.network.ipv4 = 10.0.3.3
lxc.network.ipv4.gateway = 10.0.3.1

在lxc配置文件中。/etc/network/interfaces我在容器中只有环回接口。它主要是有效的。域名解析除外。有没有办法做类似于dns-nameserversstanza in/etc/network/interfaces在lxc配置文件中所做的事情?

现在我正在考虑将网络设置移动到容器中。

networking
  • 1 个回答
  • 739 Views
Martin Hope
x-yuri
Asked: 2016-11-05 05:27:33 +0800 CST

debconf-set-selections 是否会在使用后自动从 debconf 数据库中删除值?

  • 1

考虑以下打字稿:

# export DEBIAN_FRONTEND="noninteractive"

# sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/remove-data-dir boolean true"

# echo GET mysql-community-server/remove-data-dir | debconf-communicate
0 true

# apt purge mysql-*
...

# echo GET mysql-community-server/remove-data-dir | debconf-communicate
10 mysql-community-server/remove-data-dir doesn't exist

# sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password 123456"

# sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password 123456"

# echo GET mysql-server/root_password | debconf-communicate
0 123456

# apt install mysql-server-5.6
...

# echo GET mysql-server/root_password | debconf-communicate
0

那么,debconf-set-selections这会自动吗?或者它是执行此操作的安装脚本?还有其他选择吗?

ubuntu debian debconf
  • 1 个回答
  • 689 Views
Martin Hope
x-yuri
Asked: 2015-06-08 00:57:07 +0800 CST

从 debian 的其他版本检查源包签名的简单方法

  • 0

我正在尝试nanomsg从jessieto向后移植squeeze。但是当我运行时:

dget http://http.debian.net/debian/pool/main/n/nanomsg/nanomsg_0.4~beta+dfsg-3.dsc

它说:

dscverify: nanomsg_0.4~beta+dfsg-3.dsc failed signature check:
gpg: Signature made Fri 29 Aug 2014 09:49:58 PM EEST using RSA key ID 864CC8BF
gpg: Can't check signature: public key not found
Validation FAILED!!

我看到有人建议通过在和todebian-keyring中添加相应的行来从该特定版本进行安装。但我担心它会用其他版本的软件包污染我的系统。sources.listAPT::Default-Release "stable";apt.conf

如果我们在这里谈论squeeze。我装不stable进去apt.conf可以吗?既然stable是jessie现在。如果我放在squeeze那里,升级时不要忘记另一件事debian。

如果我可以安全地下载并添加到(或设置?)以使其工作,debian-keyring我会喜欢它。可能吗?我应该如何处理这个问题?jessiekeyring /path/to/debian-keyring.gpg~/.gnupg/gpg.confDSCVERIFY_KEYRINGS

debian
  • 1 个回答
  • 261 Views
Martin Hope
x-yuri
Asked: 2014-04-09 05:44:29 +0800 CST

dget 抱怨找不到公钥

  • 3

我正在尝试反向移植一个包,但dget( dscverify) 表示由于找不到公钥,它无法检查签名:

[root ~/build/openssl] dget -x http://ftp.de.debian.org/debian/pool/main/o/openssl/openssl_0[72/753]
queeze14.dsc
dget: retrieving http://ftp.de.debian.org/debian/pool/main/o/openssl/openssl_0.9.8o-4squeeze14.dsc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2003  100  2003    0     0  27106      0 --:--:-- --:--:-- --:--:-- 47690
dget: retrieving http://ftp.de.debian.org/debian/pool/main/o/openssl/openssl_0.9.8o.orig.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3684k  100 3684k    0     0  3507k      0  0:00:01  0:00:01 --:--:-- 3615k
dget: retrieving http://ftp.de.debian.org/debian/pool/main/o/openssl/openssl_0.9.8o-4squeeze14.debia
n.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 94425  100 94425    0     0   371k      0 --:--:-- --:--:-- --:--:--  422k
openssl_0.9.8o-4squeeze14.dsc:
dscverify: openssl_0.9.8o-4squeeze14.dsc failed signature check:
gpg: keyblock resource `/root/.gnupg/secring.gpg': file open error
gpg: Signature made Mon 11 Feb 2013 11:04:16 PM EET using RSA key ID 1A5522DD
gpg: Can't check signature: public key not found
Validation FAILED!!

我尝试过更新debian-keyring包,指定dsc来自不同版本的debian. 无济于事。为什么无法验证签名?我可以忽略这个消息吗?或者我该怎么办?

debian-squeeze
  • 1 个回答
  • 2154 Views
Martin Hope
x-yuri
Asked: 2013-05-31 10:18:18 +0800 CST

nginx + fcgiwrap:为什么 fastcgi_param 的顺序很重要?

  • 6

我正在运行Debian 6.0.3( squeeze), nginx-0.7.67, fcgiwrap-1.0-1+squeeze1。这是测试脚本:

#!/usr/bin/perl
use 5.010;
use warnings;
use strict;

use Data::Dumper;

print "Content-Type: text/html\n\n";
say Dumper {map {$_ => $ENV{$_}} 'SCRIPT_NAME', 'DOCUMENT_ROOT', 'WHATEVER'};
say "$<, $>, $(, $)";

这是nginx配置:

server {
    server_name   domain.com;
    root   /home/yuri/6;
    access_log   /var/log/nginx/domain.com-access.log;
    error_log   /var/log/nginx/domain.com-error.log;

    location /cgi-bin/ {
        fastcgi_pass   unix:/var/run/fcgiwrap.socket;
        fastcgi_param   DOCUMENT_ROOT   $document_root;
        fastcgi_param   DOCUMENT_ROOT   /home/yuri/7/;
        fastcgi_param   SCRIPT_NAME   $fastcgi_script_name;
        fastcgi_param   WHATEVER   1;
        fastcgi_param   WHATEVER   2;
    }

    location /1.php {
        fastcgi_pass   unix:/var/run/php5-fpm.sock;
        fastcgi_param   PHP_ADMIN_VALUE   cgi.fix_pathinfo=1;
        fastcgi_param   REQUEST_METHOD    $request_method;
        fastcgi_param   SCRIPT_FILENAME   whatever;
        fastcgi_param   SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    }
}

如果转到 url http://domain.com/cgi-bin/1.pl ,这是我在浏览器中得到的:

$VAR1 = { 'SCRIPT_NAME' => '/cgi-bin/1.pl', 'DOCUMENT_ROOT' => '/home/yuri/7/', 'WHATEVER' => '2' };

看起来,它fcgiwrap使用第一个DOCUMENT_ROOT来查找脚本,但脚本获取参数的最后一个值。如果您更改DOCUMENT_ROOT指令的顺序,Web 服务器将返回403. 问题是……怎么会呢?

php虽然按预期工作:第二个SCRIPT_FILENAME覆盖第一个。

nginx
  • 1 个回答
  • 8725 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