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

aseq's questions

Martin Hope
aseq
Asked: 2017-08-22 17:28:38 +0800 CST

启用 fips 后 sudo 停止工作

  • 1

在 rhel6 系统上,我使用本指南启用了 fips:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-Federal_Standards_And_Regulations-Federal_Information_Processing_Standard.html

重新启动系统后,sudo 条目不再起作用。

进入 sudoers:

example        ALL=(ALL)       ALL

使用 sudo 运行的命令示例:

sudo ls -l /root
[sudo] password for example: 
/var/cache/.security.db: unable to flush: Permission denied
sudo: PERM_ROOT: setresuid(0, -1, -1): Operation not permitted
sudo: unable to open /var/db/sudo/example/2: Operation not permitted
sudo: unable to send audit message: Operation not permitted
sudo: unable to set supplementary group IDs: Operation not permitted
sudo: unable to execute /bin/ls: Operation not permitted

使用 sudo 运行脚本时的另一个错误,在 sudoers 中使用此条目:

example         ALL=/usr/local/bin/example_script.sh

结果:

sudo /usr/local/bin/example_script.sh
[sudo] password for example:
sudo: PERM_ROOT: setresuid(0, -1, -1): Operation not permitted
sudo: unable to open /var/db/sudo/example/1: Operation not permitted
sudo: unable to send audit message: Operation not permitted
sudo: unable to set supplementary group IDs: Operation not permitted
sudo: unable to execute /usr/local/bin/example_script.sh: Operation not 

可能相关的日志条目:

examplehost sudo: pam_krb5[30799]: authentication succeeds for 'example' (example@exampledomain)
examplehost sudo: example : unable to open /var/db/sudo/example/2 : Permission denied ; TTY=pts/2 ; PWD=/home/example ; USER=root ; COMMAND=/bin/ls -l /root
examplehost example : TTY=pts/2 ; PWD=/home/example ; USER=root ; COMMAND=/bin/ls -l /root
examplehost sudo: pam_keyinit(sudo:session): Unable to change GID to 0 temporarily examplehost su: pam_unix(su-l:session): session closed for user example
examplehost su: pam_unix(su-l:session): session closed for user example

请注意,系统正在使用活动目录身份验证。

我尝试将 /var/db/sudo 和 /var/cache/.security.db 移开,但没有任何效果。

sudoers 中的现有条目以及新创建的条目都会受到影响。我环顾四周,但还没有找到任何解决方案。否则系统工作正常,它接受 ssh 登录,网络服务器也在运行。

限制似乎很好:

ulimit -u
31353

cat /etc/security/limits.d/90-nproc.conf

*          soft    nproc     1024
root       soft    nproc     unlimited
centos
  • 1 个回答
  • 440 Views
Martin Hope
aseq
Asked: 2015-11-25 19:34:20 +0800 CST

无法使用 samba 工具 net 或 realm/sssd 加入域

  • 3

在 rhel7 服务器上,我试图将服务器加入域,但出现以下故障:

net ads join -S domain.example.org -U name
Enter name's password:
Failed to join domain: failed to set machine kerberos encryption types: Insufficient access

pam、krb5、samba、dns 以及远程活动目录服务器中的对象的相关设置配置正确,这意味着系统将使用 rhel6 和 ubuntu 14.04 成功绑定。

关于我遇到的具体错误,我无法找到太多信息。我试图在 krb5.conf 中设置allow_weak_crypto=true只是为了看看它是否与此有关,但它没有效果。

我遵循了https://technet.microsoft.com/en-us/library/bb463167.aspx中的一些故障排除提示,但没有运气,我尝试过的东西似乎工作正常。

具体来说,我能够执行以下操作,这意味着我可以获得用户名的初始凭据:

kinit name
Password for [email protected]: 

我还可以使用ktutil生成一个 keytab 文件,当我将它移动到 /etc/krb5.keytab klist -e时,它​​会显示正确的内容。但网络广告加入不断失败。

编辑:检查 rhel7 samba 源包后,我在README.dc中发现以下内容:

一旦 Samba AD DC 对 MIT Kerberos KDC 的支持准备就绪,我们就会提供 Samba AD DC 功能。

我怀疑这可能是问题所在,我必须等到它准备好。

Edit2:使用领域和 sssd 似乎有同样的问题。做完之后:

realm -v join --user=example ad.example.org

我发现以下错误:

* LANG=C /usr/sbin/adcli join --verbose --domain ad.example.org --domain-realm AD.EXAMPLE.ORG --domain-controller 192.0.2.11 --login-type user --login-user example --stdin-password
! Insufficient permissions to set encryption types on computer account: CN=example,OU=w,OU=x,DC=ad,DC=example,DC=org: 00002098: SecErr: DSID-03150BB9, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0

请注意,这适用于 rhel6。我也无权更改 AD 服务器或我在那里的帐户。

rhel版本为7.2,相关包在以下版本:

Name        : realmd
Version     : 0.16.1
--
Name        : adcli
Version     : 0.7.5
--
Name        : krb5-workstation
Version     : 1.13.2
--
Name        : samba-common
Version     : 4.2.3

journalctl -e SYSLOG_IDENTIFIER=realmd的净化输出:

Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain name: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using computer account name: HOST
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain realm: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Calculated computer account name from fqdn: HOST
Jan 21 14:56:20 host.example.org realmd[25796]:  * Generated 120 character computer password
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using keytab: FILE:/etc/krb5.keytab
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using fully qualified name: host.example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain name: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using computer account name: HOST
Jan 21 14:56:20 host.example.org realmd[25796]:  * Using domain realm: example.org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Looked up short domain name: AD
Jan 21 14:56:20 host.example.org realmd[25796]:  * Found computer account for HOST$ at: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Set computer password
Jan 21 14:56:20 host.example.org realmd[25796]:  * Retrieved kvno '87' for computer account in directory: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 host.example.org realmd[25796]:  ! Insufficient permissions to set encryption types on computer account: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org: 00002098: SecErr: DSID-03150BB9, problem 4003 (INSUFF_ACCESS_RIGHTS),  
Jan 21 14:56:20 host.example.org realmd[25796]:  * Modifying computer account: userAccountControl
Jan 21 14:56:20 host.example.org realmd[25796]:  * Modifying computer account: operatingSystem, operatingSystemVersion, operatingSystemServicePack
Jan 21 14:56:20 host.example.org realmd[25796]:  ! Couldn't set operatingSystem, operatingSystemVersion, operatingSystemServicePack on computer account: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org: Insufficient access
Jan 21 14:56:20 host.example.org realmd[25796]:  * Updated existing computer account: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 host.example.org realmd[25796]:  * Discovered which keytab salt to use
Jan 21 14:56:20 host.example.org realmd[25796]:  * Added the entries to the keytab: [email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:20 host.example.org realmd[25796]:  * Added the entries to the keytab: HOST/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:20 host.example.org realmd[25796]:  * Added the entries to the keytab: HOST/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 host.example.org realmd[25796]:  * Added the entries to the keytab: RestrictedKrbHost/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 host.example.org realmd[25796]:  * Added the entries to the keytab: RestrictedKrbHost/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 host.example.org realmd[25796]: process exited: 25879
Jan 21 14:56:21 host.example.org realmd[25796]:  * /usr/bin/systemctl enable sssd.service
Jan 21 14:56:21 host.example.org realmd[25796]: process started: 25880
Jan 21 14:56:21 host.example.org realmd[25796]: Created symlink from /etc/systemd/system/multi-user.target.wants/sssd.service to /usr/lib/systemd/system/sssd.service.
Jan 21 14:56:21 host.example.org realmd[25796]: process exited: 25880
Jan 21 14:56:21 host.example.org realmd[25796]:  * /usr/bin/systemctl restart sssd.service
Jan 21 14:56:21 host.example.org realmd[25796]: process started: 25894
Jan 21 14:56:22 host.example.org realmd[25796]: process exited: 25894
Jan 21 14:56:22 host.example.org realmd[25796]:  * /usr/bin/sh -c /usr/sbin/authconfig --update --enablesssd --enablesssdauth --enablemkhomedir --nostart && /usr/bin/systemctl enable oddjobd.service && /usr/bin/systemctl start oddjobd.se
Jan 21 14:56:22 host.example.org realmd[25796]: process started: 25901
Jan 21 14:56:23 host.example.org realmd[25796]: process exited: 25901
Jan 21 14:56:23 host.example.org realmd[25796]:  * Successfully enrolled machine in realm
Jan 21 14:56:23 host.example.org realmd[25796]: released daemon: current-invocation
Jan 21 14:56:23 host.example.org realmd[25796]: client gone away: :1.3100
Jan 21 14:56:23 host.example.org realmd[25796]: released daemon: :1.3100
Jan 21 14:57:23 host.example.org realmd[25796]: quitting realmd service after timeout
Jan 21 14:57:23 host.example.org realmd[25796]: stopping service

净广告的净化输出-P 状态:

objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
objectClass: computer
cn: host
distinguishedName: CN=host,OU=w,OU=x,DC=ad,DC=example,DC=org
instanceType: 4
whenCreated: 2012
whenChanged: 2016
uSNCreated: 1687590
memberOf: CN=group,OU=groups,OU=w,DC=ad,DC=example,DC=org
uSNChanged: 1212121212
name: host
objectGUID: x
userAccountControl: 6
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 1
lastLogoff: 0
lastLogon: 1
localPolicyFlags: 0
pwdLastSet: 1
primaryGroupID: 600
objectSid: S-1-5-21
accountExpires: 9
logonCount: 1
sAMAccountName: HOST$
sAMAccountType: 8
dNSHostName: host.ad.example.org
servicePrincipalName: RestrictedKrbHost/HOST
servicePrincipalName: RestrictedKrbHost/host.ad.example.org
servicePrincipalName: HOST/host.ad.example.org
servicePrincipalName: HOST/HOST
objectCategory: CN=Computer,CN=Schema,CN=Configuration,DC=ad,DC=example,DC=org
isCriticalSystemObject: FALSE
dSCorePropagationData: 2
dSCorePropagationData: 3
dSCorePropagationData: 4
dSCorePropagationData: 5
dSCorePropagationData: 6
lastLogonTimestamp: 1
active-directory
  • 3 个回答
  • 26592 Views
Martin Hope
aseq
Asked: 2015-03-04 18:05:22 +0800 CST

限制用户更改 xscreensaver 设置

  • 1

我想知道人们提出的任何解决方案,以限制用户更改 xscreensaver 的系统范围配置。我的部分工作是管理要求桌面在大约 10 分钟内锁定并且只能使用密码解锁的系统。我想使用一个屏幕保护程序,并且考虑到 xscreensaver 具有成熟的代码库非常安全,这是一个合乎逻辑的选择。

我在 /etc/X11/app-defaults/XScreenSaver* 中创建了适当的设置,但问题是用户仍然可以通过运行 xscreensaver-demo 或编辑 ~/.xscreensaver 来更改他们的个人偏好。

我知道有一种黑客的方法可以做到这一点,从 /usr/bin/xscreensaver-demo 中删除可执行权限并将 ~/.xscreensaver 的所有权更改为 root。

如果这是唯一可行的方法,我将如何在用户初始登录时(在 redhat 和 debian/ubuntu 中)创建具有 root 所有权的 ~/.xscreensaver?

linux
  • 2 个回答
  • 1564 Views
Martin Hope
aseq
Asked: 2014-03-18 16:36:17 +0800 CST

如何在 Debian 或 Ubuntu 中使用 kickstart 创建加密分区

  • 1

我正在使用 kickstart 和网络引导设置 Ubuntu 的自动安装。使用 redhat 这工作得很好,但是 Ubuntu kickstart 似乎相当有限,我找不到描述可用选项的文档。

对我来说似乎缺少的最重要的是:

--加密

IE:

部分 /home --size=35000 --grow --fstype=xfs --encrypted

为了创建加密分区。但是安装程序抱怨选项 --encrypted 无法识别,并继续使用未加密的分区。

有没有办法通过 Ubuntu(和 Debian)的 kickstart 自动创建加密分区?

此外,是否有任何可用的文档描述可用于 Ubuntu 和 Debian 的 kickstart 选项?我知道 redhat 在这方面的文档,但是由于缺少或不同的功能,在这种情况下它的使用有限。

linux
  • 1 个回答
  • 1100 Views
Martin Hope
aseq
Asked: 2014-03-06 11:31:36 +0800 CST

yum 更新后防止重启

  • 1

我想知道如何在运行yum update后阻止系统重新启动。

我在每个系统上使用一个脚本,该脚本通过 cron 运行每日 yum 更新,如果 uodate 足够重要(例如新内核版本),它将检查是否有任何用户登录以及是否正在运行某些应该推迟重启的特定软件. 如果不是这种情况,它将安排重新启动。

但是,这似乎(不再)工作得很好。几分钟后,手动或我的脚本运行的 yum 更新完成后,系统将重新启动。我需要知道使用哪种机制来安排重新启动以及如何控制它。有许多系统,例如运行模拟数周的系统,我不想重新启动。对于那些系统来说,传播关键内核修复不如保持其正常运行重要。我试图找到信息,但还没有。

我确实检查了 cronjobs 作为第一个可能的原因之一,但找不到任何可疑的东西。此外,当启用 uodate 脚本的 cronjob 并且我手动运行yum update时,系统仍会在更新完成后几分钟后重新启动。Yum 也不会出现一些自定义安装的“warapper”脚本。

编辑:问题是,即使我禁用了运行更新的 cronjob,包含脚本和 cronjob 条目的包也已更新,因此它会重新安装 cronjob 并导致脚本运行并重新启动。修复脚本...

linux
  • 1 个回答
  • 1877 Views
Martin Hope
aseq
Asked: 2013-05-09 18:14:16 +0800 CST

升级到 wheezy apache 后无法启动

  • 5

我已经从 lenny 升级到 wheezy,现在 apache 无法启动:

# /etc/init.d/apache2 start                                                                                                                                                             
Starting web server: apache2[Wed May 08 19:01:08 2013] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null)
Syntax error on line 17 of /etc/apache2/ports.conf:
Listen setup failed
Action 'start' failed.
The Apache error log may have more information.
 failed!

ports.conf 的第 17 行当然是正确的:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

#NameVirtualHost *:80
#Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

看起来它与我正在运行的内核中不存在的一些内核调用有关:http: //major.io/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket -for-null/

这是一个xen VPS,内核版本是2.6.26-amd64。我现在无法更新内核,因为提供商需要做一部分。我已经发送了请求,但我不知道他们需要多长时间。

在我有机会更新内核之前,有没有办法让它工作?

linux
  • 2 个回答
  • 4491 Views
Martin Hope
aseq
Asked: 2013-02-26 19:04:32 +0800 CST

如何防止 rsync(使用 ssh 作为远程 shell)面对密码提示

  • 5

我想在不需要输入密码的情况下运行 rsync。我知道我可以使用 ssh 密钥执行此操作,一旦将正确的密钥复制到远程服务器,rsync 日志就可以正常登录,无需用户交互。

但是,当密钥已更改、已删除,或者说在某些自动化的情况下,服务器已添加到要进行 rsync 的服务器列表中时,我希望 rsync 不会提示输入密码。

意思是,rsync 应该只尝试通过 ssh 使用无密码登录,如果这不起作用,则继续前进,而不必处理密码提示和可能的长时间超时。

linux
  • 1 个回答
  • 1793 Views
Martin Hope
aseq
Asked: 2012-08-18 12:48:42 +0800 CST

为什么添加数据文件会导致 Oracle 中出现死锁?

  • 4

我在 Oracle 中注意到一些以前从未发生过的事情。虽然我现在经常做这种事很多年了。在这种情况下,它是一个 Oracle11 实例(Oracle 数据库 11g 企业版版本 11.2.0.1.0 - 准确地说是在 Linux 上运行的 64 位)。

我正在导入一个转储文件,同时我正在使用如下语句增加表空间:

alter tablespace example add datafile '/path/to/oradata/instance/exampleXX.dbf' size 31000m;

运行上述语句时有时会出现以下错误:

ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource

我可以重新启动 alter tablespace 语句,它在第二次尝试时通常会正常运行。

我问为什么会这样,因为这对我来说很不寻常。它是否表示错误或阻碍文件系统故障?我知道同时运行导入和将数据文件添加到表空间可能对服务器有很多要求,但这是服务器有 4 个 CPU、64 GB 和几 TB 的 SAS raid10 可供使用。

顺便说一句,这不是生产系统。

相关跟踪文件输出:

Deadlock graph:                                                                                                                                                   
                       ---------Blocker(s)--------  ---------Waiter(s)---------                                                                                   
Resource Name          process session holds waits  process session holds waits                                                                                   
TT-00000006-00000010        36      11          SX       38     142           S                                                                                   
TT-00000006-00000010        38     142     S             36      11          SX                                                                                   

session 11: DID 0001-0024-0000005D      session 142: DID 0001-0026-00000068                                                                                       
session 142: DID 0001-0026-00000068     session 11: DID 0001-0024-0000005D                                                                                        

Rows waited on:                                                                                                                                                   
  Session 11: no row                                                                                                                                              
  Session 142: no row                           

----- Information for the OTHER waiting sessions -----                                                                                                            
Session 142:                                                                                                                                                      
  sid: 142 ser: 30639 audsid: 0 user: 5/SYSTEM flags: 0x8000051                                                                                                   
  pid: 38 O/S info: user: example_user, term: UNKNOWN, ospid: 14589                                                                                                   
    image: example@example (DW00)                                                                                                                                     
  current SQL:                                                                                                                                                    
  CREATE TABLE EXAMPLE ...

----- Error Stack Dump -----                                                                                                                                      
ORA-00060: deadlock detected while waiting for resource                                                                                                           
----- Current SQL Statement for this session (sql_id=6bvzdgdn8vqqt8) -----                                                                                         
alter tablespace ...

堆栈跟踪和内存转储可以提供更多信息,但我不是解决这些问题的专家。我所追求的是它可能是什么的想法,之前发生过这种情况的人可以做出有根据的猜测。如果它是一个错误,则表明文件系统可能有问题,或者 raid 控制器无法处理负载。为什么两条语句都在等待资源,为什么这个资源不可用。

linux
  • 4 个回答
  • 2093 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