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

Viktor's questions

Martin Hope
Viktor
Asked: 2024-06-02 23:27:51 +0800 CST

在 Wireguard 中阻止对客户端的 LAN 访问

  • 4

我有一个 Wireguard 服务器在我家庭 LAN 的树莓派上运行。我想让居住在不同国家/地区的亲戚访问我的 VPN,以便他可以自由使用被当地 ISP 阻止的互联网服务,但我不希望他访问我 LAN 上的设备。有没有办法配置 Wireguard 服务器来实现这一目标?

我的服务器配置是:

# wg0.conf

[Interface]
Address = 10.24.36.1/24
MTU = 1420
SaveConfig = true
ListenPort = 51820
PrivateKey = 111

[Peer]
PublicKey = 222
PresharedKey = 333
AllowedIPs = 10.24.36.2/32
Endpoint = 172.19.188.166:11262

[Peer]
PublicKey = 444
PresharedKey = 555
AllowedIPs = 10.24.36.3/32
Endpoint = 172.18.164.218:7833

典型的客户端配置:

[Interface]
PrivateKey = 666
Address = 10.24.36.3/24
DNS = 8.8.8.8, 8.8.4.4

[Peer]
PublicKey = 777
PresharedKey = 555
AllowedIPs = 0.0.0.0/0
Endpoint = my-ip.no-ip.com:41234
vpn
  • 1 个回答
  • 23 Views
Martin Hope
Viktor
Asked: 2023-08-03 01:25:21 +0800 CST

root 没有看到 FUSE 安装目录

  • 5

我的 debian 机器上有一项服务,可以将 google 驱动器安装到目录/home/myuser/gdrive:

[Unit]
Description=FUSE filesystem over Google Drive
After=network.target

[Service]
User=myuser
Group=myuser
ExecStart=google-drive-ocamlfuse /home/myuser/gdrive
ExecStop=fusermount -u /home/myuser/gdrive
Restart=always
Type=forking

[Install]
WantedBy=multi-user.target

我还有一个 cron 作业,它将目录从一个文件夹复制到gdrive. 问题是root用户由于某种原因看不到gdrive目录。

sudo ls -la /home/myuser/
ls: cannot access '/home/myuser/gdrive': Permission denied
total 1700
...
d?????????  ? ?    ?          ?            ? gdrive
...
ls -la ~/
total 1704
...
drwxr-xr-x  2 myuser  myuser     4096 Aug  2 09:24 gdrive
linux
  • 2 个回答
  • 27 Views
Martin Hope
Viktor
Asked: 2021-01-23 06:34:01 +0800 CST

从不同子网访问节点

  • 1

我制作了一个网络应用程序,安装在连接到我们公司局域网的专用服务器上。我只有一个问题。LAN 上的所有节点都有 192.168.138.x 子网掩码。但是 wi-fi 接入点有一个子网 192.168.10.x。如果我理解正确是因为出于安全原因,wi-fi 路由器启用了 DHCP 服务器。我尝试与我们的 IT 服务提供商交谈,但他们看着我就像我对他们说中文一样。如果我希望我的服务器可以通过 wi-fi 访问,最好的行动原因是什么?

更新:

路由器:瞻博网络 ACX1100 路由器

router routing networking wifi local-area-network
  • 2 个回答
  • 395 Views
Martin Hope
Viktor
Asked: 2020-11-14 09:22:08 +0800 CST

使用 pgpass 的身份验证不起作用

  • 0

我正在尝试在 Debian 的本地无头服务器上为 postgres db 设置自动备份。我有一个脚本:

#!/bin/bash
export PGPASSFILE='/home/mtn/.pgpass'
pg_dumpall -U db_user --verbose 2>/var/log/postgresql/pgdump.log | gzip > /mnt/bulk-data/db_backup/db_bak.gz

有一个.pgpass文件:

-rw-------  1 mtn  mtn     47 Nov 13 10:14 .pgpass

和:

*:*:*:postgres:guest
*:*:*:db_user:guest

还有一份sudo crontab -e工作:

20 0 * * * /home/mtn/backup.sh >/dev/null 2>&1

pg_hba:

local   all             postgres                                peer

当我尝试运行它时,我得到:

pg_dumpall: error: could not connect to database "template1": FATAL:  Peer authentication failed for user "db_user"

哪里错了?

PS 如果我将脚本更改为以 root 身份运行,一切正常sudo -u postgres pg_dumpall。

更新:最终对我有用的是将此行添加到pg_ident.conf:

omicron           root                    postgres

然后pg_hba.conf在一切之前:

local   all      all                 ident map=omicron

并将脚本更改为pg_dumpall以用户身份运行postgres(仅因为db_user没有所有必要的特权dumpall)。

debian cron postgresql
  • 1 个回答
  • 1313 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