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
    • 最新
    • 标签
主页 / server / 问题

问题[mapping](server)

Martin Hope
Dipr
Asked: 2021-03-18 03:46:15 +0800 CST

NFS4 w/o Kerberos:名称映射有效,权限无效

  • 2

我只是想在 NFS4 客户端和 NFS4 服务器之间“按用户名映射”,当每个给定用户名具有不同的 uid 时,无需设置 Kerberos。

情况:我的Linux机器(centos 7)访问各种NFS4服务器(运行centos 7)

  • 没有可用的 Kerberos 或 NIS 或 AD
  • 每个服务器都有不同的 dns 域(都与我的 linux box 的 DNS 域不同)
  • 服务器和我的 linux 客户端具有不同步的 UID(每个用户名“oracle”具有不同的本地 uid)
  • echo N > /sys/module/nfsd/parameters/nfs4_disable_idmapping在服务器和客户端上完成
  • 名称映射守护进程 rpcidmapd 在客户端和服务器上启动
  • 客户端/etc/idmapd.conf为用户提供静态映射
  • 安装为 nfs4(sec=sys,因为没有集中的 Kerberos/etc)可以工作
  • ls -l显示“正确”的用户名和组名
  • 但是权限被忽略了,我必须设置 world rwx 来访问/遍历/写入文件,为什么?

背景问题:

  • 哪一方(客户端或服务器)应该将名称映射到 id?

  • 我的客户端上的 idmapd.conf 是否正确(例如远程 NFS4 服务器 DNS 域是 eh.loc):

     [General]
     Verbosity = 7
     [Mapping]
     [Translation]
     Method = static
     [Static]
     [email protected] = oracle
     [email protected] = oinstall
     [email protected] = dba
    
file-permissions nfs4 name mapping
  • 1 个回答
  • 429 Views
Martin Hope
Hasani
Asked: 2020-08-29 09:38:27 +0800 CST

为什么我的域没有映射到服务器地址?

  • 1

我已按照以下说明在远程服务器上安装了 DNS 服务器和网络管理器:https ://www.linuxtechi.com/setup-bind-server-centos-8-rhel-8/ ,如下所示:

var/named/fwd.sssss.com.db:

$TTL 86400
@   IN  SOA     ns1.sssss.com. root.sssss.com. (
                                              1490        ;Serial
                                              3600        ;Refresh
                                              1800        ;Retry
                                              604800      ;Expire
                                              86400       ;Minimum TTL
)

;Name Server Information
@       IN  NS      ns1.sssss.com.
@       IN  NS      ns2.sssss.com.



;IP address of Name Server
ns1       IN  A       94.130.98.33
ns2       IN  A       94.130.98.33
sssss.com.       IN  MX   10    mail.sssss.com.

;A - Record HostName To Ip Address
sssss.com.     IN  A       94.130.98.33
www             IN  A       94.130.98.33
mail            IN  A       94.130.98.33
@               IN  A       94.130.98.33

;CNAME record
ftp     IN CNAME        www.sssss.com.

var/named/sssss.com.rev:

$TTL 86400
@   IN  SOA     ns1.sssss.com. root.sssss.com. (
                                       1490        ;Serial
                                       3600        ;Refresh
                                       1800        ;Retry
                                       604800      ;Expire
                                       86400       ;Minimum TTL
)

;Name Server Information
@       IN  NS          ns1.sssss.com.
@       IN  NS          ns2.sssss.com.
ns1     IN  A           94.130.98.33
ns2     IN  A           94.130.98.33


;Reverse lookup for Name Server
33      IN  PTR         ns1.sssss.com.
33      IN  PTR         ns2.sssss.com.
33.98.130.94.in-addr.arpa    IN  PTR         ns1.sssss.com.
33.98.130.94.in-addr.arpa    IN  PTR         ns2.sssss.com.

;PTR Record IP address to HostName
33      IN  PTR         www.sssss.com.
33      IN  PTR         sssss.com.
33      IN  PTR         mail.sssss.com.
33.98.130.94.in-addr.arpa    IN  PTR         www.sssss.com.
33.98.130.94.in-addr.arpa    IN  PTR         sssss.com.
33.98.130.94.in-addr.arpa    IN  PTR         mail.sssss.com.

等/named.conf:

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
        //listen-on port 53 { 127.0.0.1; };
        //listen-on-v6 port 53 { ::1; };
        listen-on port 53 { 127.0.0.1; 94.130.98.33; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        secroots-file   "/var/named/data/named.secroots";
        recursing-file  "/var/named/data/named.recursing";
        allow-query     { localhost; 94.130.98.33; };

        /*
         - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
         - If you are building a RECURSIVE (caching) DNS server, you need to enable
           recursion.
         - If your recursive DNS server has a public IP address, you MUST enable access
           control to limit queries to your legitimate users. Failing to do so will
           cause your server to become part of large scale DNS amplification
           attacks. Implementing BCP38 within your network would greatly
           reduce such attack surface
        */
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";

        /* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
        include "/etc/crypto-policies/back-ends/bind.config";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};
//forward zone
zone "sssss.com" IN {
        type master;
        file "fwd.sssss.com.db";
        allow-update { none; };
        allow-query  { any; };
};

//backward zone
zone "98.130.94.in-addr.arpa" IN {
        type master;
        file "sssss.com.rev";
        allow-update { none; };
        allow-query  { any; };
};

/etc/sysconfig/network-scripts/ifcfg-enp0s3:

# Generated by parse-kickstart
TYPE="Ethernet"
DEVICE="enp0s3"
UUID="467a30cc-f47a-4c63-a335-f8afab26f559"
ONBOOT="yes"
IPADDR0="94.130.98.33"
BOOTPROTO=dhcp
IPV6INIT="no"
DNS=94.130.98.33

等/resolv.conf:

# Generated by NetworkManager
search sssss.com
nameserver 94.130.98.33

Nginx 在我的服务器地址上工作:94.130.98.33 但我的域不起作用!

编辑:这是dig @94.130.98.33 sssss.com any(真正的域名是sssss而不是sssss:

; <<>> DiG 9.11.13-RedHat-9.11.13-5.el8_2 <<>> @94.130.98.33 sssss.com any
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54410
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 4

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: c279563b1d3fe85ccebd7b085f4a20a5d456e6e90441bac5 (good)
;; QUESTION SECTION:
;sssss.com.                    IN      ANY

;; ANSWER SECTION:
sssss.com.             86400   IN      SOA     ns1.sssss.com. root.sssss.com. 1490 3600 1800 604800 86400
sssss.com.             86400   IN      NS      ns2.sssss.com.
sssss.com.             86400   IN      NS      ns1.sssss.com.
sssss.com.             86400   IN      MX      10 mail.sssss.com.
sssss.com.             86400   IN      A       94.130.98.33

;; ADDITIONAL SECTION:
ns1.sssss.com.         86400   IN      A       94.130.98.33
ns2.sssss.com.         86400   IN      A       94.130.98.33
mail.sssss.com.        86400   IN      A       94.130.98.33

;; Query time: 1 msec
;; SERVER: 94.130.98.33#53(94.130.98.33)
;; WHEN: Sat Aug 29 11:32:21 CEST 2020
;; MSG SIZE  rcvd: 229
domain centos8 dns-server mapping
  • 2 个回答
  • 97 Views
Martin Hope
Sethos II
Asked: 2017-02-14 01:41:11 +0800 CST

与 SSSD 和 SMB 的 ID 映射

  • 3

我正在尝试让 samba 共享在 Windows (SID) 和 Linux (uid/gid) 客户端上使用正确的 ID。问题是 uid 和 gid 没有正确映射回 SID 并且 SID 没有解析为名称。什么可能导致这个问题,如何解决?

什么有效

  • 从 Active Directory UNIX 属性映射到 Linux 上的 uid/gid
  • 访问共享
    • Windows:资源管理器中的 UNC-Path,接受 Kerberos 票证(凭证没有问题)
    • Linux:sudo mount -t cifs //ribonas2/test /mnt/ribonas2/smb/ -o domain=DOMAIN,username=paul.jaehne
  • 处理共享上的文件

什么不起作用

  • 在 Windows 上创建的文件具有Unix User\和Unix Group\(在打开安全选项卡时,UNIX uid 和 gid 也会在很短的时间内可见)而不是DOMAIN\作为用户和组的前缀
  • 添加权限是有缺陷的:我可以从域中添加主体,然后很快就会DOMAIN\whatever正确显示。当我等待一段时间或从另一台计算机查看共享时,仅显示 SID(SID 正确,但未解析为名称):

看图片

环境/配置

  • 我使用了以下指南(由于信誉要求,无法添加真实链接):
    • Ubuntu 16.04 SAMBA 文件服务器指南
    • Ubuntu 16.04 SSSD AD 指南
    • SAMBA 维基域成员
    • SAMBA 维基 ACL
  • 多个域控制器(Windows Server 2003 和 Windows Server 2012 R2)
  • Windows Server 2003 中的 Active Directory 架构
  • Ubuntu 服务器 16.04
    • SSSD 1.13.4-1ubuntu1.1
    • SMB 2:4.3.8+dfsg-0ubuntu1
    • 加入了两者realm join和net ads join

sssd.conf:

[sssd]
domains = domain.company.com
config_file_version = 2
services = nss, pam

[domain/domain.company.com]
realmd_tags = manages-system joined-with-adcli
ad_domain = domain.company.com
krb5_realm = DOMAIN.COMPANY.COM

id_provider = ad
cache_credentials = True
krb5_store_password_if_offline = True
enumerate = True
use_fully_qualified_names = False

fallback_homedir = /home/%d/%u
default_shell = /bin/bash

# use uid and gid from active directory
ldap_id_mapping = False

# needed to use correct active directory properties (Windows Server 2003)
ldap_schema = ad
ldap_user_object_class = person
ldap_user_name = msSFU30Name
ldap_user_uid_number = msSFU30UidNumber
ldap_user_gid_number = msSFU30GidNumber
ldap_user_home_directory = msSFU30HomeDirectory
ldap_user_shell = msSFU30LoginShell
ldap_user_gecos = displayName
ldap_group_object_class = group
ldap_group_name = msSFU30Name
ldap_group_gid_number = msSFU30GidNumber

smb.conf(标准配置文件中的设置是缩进的):

[global]
server role = member server
workgroup = DOMAIN
realm = DOMAIN.COMPANY.COM
security = ads
password server = dc1.domain.company.com # shouldn't be necessary and same problem without this line
idmap config * : backend = tdb
idmap config * : range = 100000-999999
idmap config DOMAIN : backend = ad
idmap config DOMAIN : range = 10000-20000 # the UNIX attributes are manually assigned in this range
kerberos method = secrets and keytab

    server string = %h server (Samba, Ubuntu)

    dns proxy = no

    log file = /var/log/samba/log.%m
log level = 10
    max log size = 1000
    syslog = 0

    panic action = /usr/share/samba/panic-action %d

    passdb backend = tdbsam
    obey pam restrictions = yes
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    pam password change = yes

    map to guest = bad user

    usershare allow guests = yes

# needed for Windows ACL/ACE
vfs objects = acl_xattr
map acl inherit = yes
store dos attributes = yes

[test]
    path = /srv/samba/test
    writable = yes

TL;DR:为什么 UNIX 属性不解析为 SID,为什么 SID 不解析为名称?

active-directory server-message-block ubuntu-16.04 sssd mapping
  • 3 个回答
  • 18232 Views
Martin Hope
Bill Daugherty
Asked: 2017-01-31 07:43:17 +0800 CST

通过 GPO 授予对映射驱动器的独占 AD 访问权限

  • 1

我想知道如何为用户提供对文件夹的独占访问权限,而不是其他文件夹。文件夹根位于此处:

DC1\\UserFolders\%username%

我使用 GPO 来映射该用户的文件夹。但问题是它只有在用户有权访问根文件夹时才会映射。这样做的问题是,他们可能会多管闲事并导航到其他用户的文件夹。

我正在寻求有关脚本的帮助,该脚本允许我使该用户文件夹仅对该人专有。并且不可能看到其他文件夹的能力。

以下是我尝试过的(添加到启动脚本中):

icacls D:\UserFolder /inheritance:d
icacls D:\UserFolder\%username% /grant "%username%":(m)

但它似乎没有做任何事情。我做错了什么,有没有更好的脚本来运行这个?

group-policy active-directory icacls mapping
  • 1 个回答
  • 553 Views
Martin Hope
Hemanth
Asked: 2012-07-19 20:01:00 +0800 CST

路由映射从允许更改为拒绝保留匹配标记值

  • 0

我在我的 cisco 路由器上配置了一个路由映射,名称为 s1,序列号为 10(默认),其中包含匹配标记 10。如果我再次尝试使用相同的序列号 10(默认)配置相同的路由映射名称较新的匹配标签 20 它实际上是在匹配标签 20 上附加 10。这是预期的吗?因为我已经从允许更改为拒绝,它不应该清除以前的值吗???

R1(config)#route-map s1 per
R1(config)#route-map s1 permit
R1(config-route-map)#mat
R1(config-route-map)#match tag
R1(config-route-map)# match tag 10
R1(config-route-map)#do sh route-map
route-map s1, permit, sequence 10
匹配子句:
tag 10
Set 子句:
策略路由匹配:0 数据包,0 字节
R1(config-route-map )#exit
R1(config)#route
R1(config)#route-
R1(config)#route-map s1 deny
R1(config)#route-map s1 deny
R1(config-route-map)#match
R1(config- route-map)#match tag
R1(config-route-map)#match tag 20
R1(config-route-map)#do sh route-map
route-map s1, deny, sequence 10
Match clauses:
tag 10 20
Set clauses:
Policy routing 匹配: 0 packets, 0 bytes
R1(config-route-map)#

cisco ios route mapping
  • 1 个回答
  • 552 Views
Martin Hope
gozu
Asked: 2012-07-17 09:10:05 +0800 CST

如何绘制包含 Cisco 和 *NIX 框的第 2 层(链路层)网络图?

  • 2

我的任务是绘制我们非常小的数据中心网络的第 2 层网络图。

有一台1841 cisco路由器,两台3560 cisco catalyst交换机和4台solaris sunfire T-1000盒子。

我已经登录到 cisco 框并下载了所有 3 个的运行配置文件。我还获得ifconfig -a了 4 个 solaris 框的输出。

我的问题是:我现在应该做什么阅读/学习来把它们放在一起?有小费吗?

我正在寻找诸如lanmap2 之类的工具,但它适用于 linux,而不是 SunOS,我不知道自己是否可以成功地重新编译它。

我了解中级网络,但我不是路由专家。我知道 VLAN 是一种将不同交换机中的端口组隔离在各自子网中的方法,我听说中继是两个路由器之间的连接,用于传送 VLAN 信息,但这就是我对这两个主题的了解程度。

networking solaris cisco cisco-catalyst mapping
  • 2 个回答
  • 2922 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