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

Zumo de Vidrio's questions

Martin Hope
Zumo de Vidrio
Asked: 2020-03-11 01:38:54 +0800 CST

错误地直接挂载在 /mnt 上

  • 1

我在两个文件夹之间执行了 rsync:

rsync -avzh /mnt/folder1 /mnt/folder2

(文件夹 1 是 /dev/sdb,文件夹 2 是 /dev/sdc,都是 ext4 分区)

然后我卸载了folder1,我犯了一个错误,我直接在/mnt上安装了/dev/sdc:

mount /dev/sdc /mnt

实际上我想在 /mnt/folder1 上挂载 /dev/sdc

现在我无法卸载 /mnt:

umount /mnt/
umount: /mnt/: target is busy
    (In some cases useful info about processes that
     use the device is found by lsof(8) or fuser(1).)

我怎样才能解决这个问题?

ubuntu mount
  • 2 个回答
  • 51 Views
Martin Hope
Zumo de Vidrio
Asked: 2019-12-14 07:23:14 +0800 CST

带有公钥的 SSH 连接不适用于特定名称

  • 0

当尝试连接到服务器时:

ssh -i MYKEY_SSH user@IP

它提示输入密码。但是,如果我将该键重命名为任何其他名称,则连接已正确建立。

也就是说,如果我这样做:

cp MYKEY_SSH whatever_ssh

然后

ssh -i whatever_ssh user@IP

可以直接连接。

我无法弄清楚问题出在哪里。

我的本地系统中没有特定的 ssh 配置,重命名时权限也没有变化。

在不成功的 SSH 密钥连接中,调试说:

debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: key_ssh
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password

在一个成功的例子中,我看到之后它说:

debug1: Trying private key: key_ssh
debug1: Authentication succeeded (publickey).
Authenticated to IP ([IP]:22).
ssh key-authentication
  • 1 个回答
  • 1465 Views
Martin Hope
Zumo de Vidrio
Asked: 2019-08-08 00:33:09 +0800 CST

通过代理的 LDAP 连接

  • 1

我有以下基础设施:

LDAP(外部网络) - SQUID - HOST1,HOST2,HOST3...

它们都是 Ubuntu 服务器。

我需要能够通过端口 636 从主机发出 LDAPS 请求,但是我无法从它们访问 LDAP 服务器。

我努力了:

  • 通过 squid 在基于端口的 acl 中转发 ldaps 请求(由于 squid 专门针对 http 流量,所以不起作用)
  • 直接在主机上应用静态路由(不起作用,因为我无法将任何其他网关添加到我已经存在的接口。
  • 使用 iptables 转发不起作用,因为我找不到从 LDAP 服务器仅将答案返回到先前发出请求的主机的方法。

有任何想法吗?

routing iptables
  • 1 个回答
  • 378 Views
Martin Hope
Zumo de Vidrio
Asked: 2019-07-09 03:14:18 +0800 CST

HTTPS 代理中继

  • 0

在 Ubuntu 16.04 机器中,我使用 squid 3.5.12 设置了代理中继配置,如下所示:

External_proxy <-> Internal_proxy <-> 主机

此时,从外部和内部代理我都可以访问 http 和 https 网站,但从主机我只能访问 http 网站。

我squid.conf在 internal_proxy 中的当前是:

http_port 3128
logformat lmc %ts %la %>a %ul %<A %rm %ru %mt %>Hs %Ss "%{Referer}>h" "%{User-Agent}>h" %>st %<st %tr %<pt %<tt
access_log syslog:local1.info
access_log syslog:local0.info lmc
icp_port 0
cache_peer <external_proxy_IP> parent 8080 0 proxy-only originserver
acl SSL_ports port 443 
acl Safe_ports port 80
acl Safe_ports port 443
acl local_subnet src 192.168.100.0/24
acl CONNECT method CONNECT
http_access allow CONNECT local_subnet
http_access allow local_subnet Safe_ports
http_access allow local_subnet SSL_ports
http_access deny all
connect_timeout 510 minutes
request_timeout 500 minutes
cache_dir ufs /var/cache/squid 8192 16 256
shutdown_lifetime 2 seconds
hierarchy_stoplist cgi-bin ?
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
ftp_epsv off
via off
never_direct allow all
visible_hostname "internal_proxy_hostname"

当我尝试连接到某个 https 站点时,我收到以下信息:

wget https://google.com
--2019-07-08 13:08:23--  https://google.com/
Connecting to internal_proxy:3128... connected.
Proxy tunneling failed: Service UnavailableUnable to establish SSL connection.

在 internal_proxy 日志中:

TAG_NONE/503 0 CONNECT google.com:443 - HIER_NONE/- -
CONNECT google.com:443 - 503 TAG_NONE "-"

我试过这个程序:但结果是一样的。

注意:我无权访问 external_proxy 配置

squid http-proxy
  • 1 个回答
  • 2024 Views
Martin Hope
Zumo de Vidrio
Asked: 2019-06-20 06:40:34 +0800 CST

Pamldap 连接被拒绝

  • 0

我正在尝试通过 Ubuntu 16.04 中的 pamldap 设置 ssh 访问,并且在配置完所有内容后,我无法将 /etc/passwd 与 LDAP 服务器的信息同步。

ldapsearch 工作正常,因此绑定选项配置良好。

当我做

getent group

我可以看到所有 LDAP 服务器组,但是

getent passwd

只有本地用户信息。

通过调试 nslcd,我可以看到每当我尝试使用 ldap 用户登录(su 或 ssh)时,它都能在 LDAP 服务器中找到我的用户。

另外: su ldap_user 返回:

用户没有密码条目

当我尝试 ssh 连接时,auth.log 写道:

Invalid user ldap_user from IP
input_userauth_request: invalid user ldap_user [preauth]
pam_unix(sshd:auth): check pass; user unknown
pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=IP
pam_sss(sshd:auth): Request to sssd failed. Connection refused
pam_ldap(sshd:auth): Authentication failure; user=ldap_user
Failed password for invalid user ldap_user from IP port 55911 ssh2

nsswitch.conf文件有:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap
gshadow:        files

hosts:          files dns ldap
networks:       files ldap

protocols:      db files ldap
services:       db files ldap
ethers:         db files ldap
rpc:            db files ldap

netgroup:       nis ldap
sudoers:        files
ssh authentication
  • 1 个回答
  • 450 Views
Martin Hope
Zumo de Vidrio
Asked: 2018-06-08 05:35:21 +0800 CST

共享磁盘文件同步

  • 0

我有两台 Centos 7 服务器,它们通过 fstab 安装了一个共享磁盘,其中:

/dev/sdb /mnt/shared   xfs  rw,suid,dev,noexec,auto,user,sync      0  0

我可以在两台服务器上看到磁盘及其内容,但是当我创建一个新文件时,它不会自动在对面服务器上看到。如果我卸载并安装磁盘,则会出现文件。

创建文件后执行sync也不会创建文件。

我已经按照这里的建议安装了 lsyncd,但没有任何改变。

centos mount
  • 1 个回答
  • 1130 Views
Martin Hope
Zumo de Vidrio
Asked: 2017-11-29 03:34:26 +0800 CST

使用带双引号的 sed

  • 2

回答这个问题:

sed我在4.2.2 版本中发现了以下情况。

从这个输入:

send host-name = gethostname();
    domain-name, domain-name-servers, domain-search, host-name,
#  option host-name "andare.swiftmedia.com";

我只想从第二行中删除字符串“主机名”,所以预期的输出是:

send host-name = gethostname();
    domain-name, domain-name-servers, domain-search,
#  option host-name "andare.swiftmedia.com";

然后我使用了以下命令:

sed -e 's/" host-name,"//g' input_file

但是,它不会删除 input_file 上的“主机名”字符串,使其保持原样。

如果我不使用双引号:

sed -e 's/ host-name,//g' input_file

它正确地给出了预期的输出。

我认为正确的方法是使用双引号,但无法弄清楚为什么它在这里不起作用。

sed string
  • 1 个回答
  • 10546 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve