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

Julien's questions

Martin Hope
Julien
Asked: 2013-05-04 03:32:00 +0800 CST

宽容模式下的 Selinux,基于 ssh 密钥的身份验证和锁定帐户

  • 1

我注意到在宽容模式下,基于 ssh 密钥的登录和 selinux 有一些奇怪的地方。

让我向您介绍设置:服务器是更新的 Centos 6.4 x86_64。

我们创建没有密码的用户(然后用户将被锁定):

# useradd testuser
# passwd -S testuser
testuser LK 2013-05-03 0 99999 7 -1 (Password locked.)

然后我们设置 ssh 密钥:

# install -d -m 700 -o testuser -g testuser /home/testuser/.ssh/
# install -m 600 -o testuser -g testuser /root/.ssh/id_rsa.pub /home/testuser/.ssh/authorized_keys

让我们检查一下selinux状态

# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

然后让我们尝试以 testuser 身份登录:

# ssh testuser@localhost
Last login: Fri May  3 13:26:32 2013 from ::1
$

有用 !现在我们将 Selinux 设置为宽容模式

# setenforce 0
# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

我们再次尝试登录:

# ssh testuser@localhost
testuser@localhost's password:

SSH 不接受密钥并要求输入密码!

问题:那是一个错误吗?

编辑:在 restorecon -Rv /home 之后,我有

$ ls -laZ ~/.ssh/
drwx------. user wheel unconfined_u:object_r:ssh_home_t:s0 ./
drwxr-x---. user wheel unconfined_u:object_r:user_home_dir_t:s0 ../
-rw-------. user wheel system_u:object_r:ssh_home_t:s0  authorized_keys

$ getsebool -a | grep 'ssh'
allow_ssh_keysign --> off
fenced_can_ssh --> off
ssh_chroot_full_access --> off
ssh_chroot_manage_apache_content --> off
ssh_chroot_rw_homedirs --> off
ssh_sysadm_login --> off

编辑:这是 /var/log/secure 的内容

Jun 13 16:30:51 dhcp-240 sshd[13681]: User testuser not allowed because account is locked
Jun 13 16:30:51 dhcp-240 sshd[13682]: input_userauth_request: invalid user testuser
centos6
  • 2 个回答
  • 7334 Views
Martin Hope
Julien
Asked: 2009-07-22 06:59:53 +0800 CST

数据中心自动化工具和 Novell Suse Linux?

  • 2

我正在寻找信息来自动化数百台Suse机器的修补/更新过程。除了Zenworks和SMT之外,您还知道其他对 Novell SLES 操作系统有良好支持的补丁管理/自动化工具吗?

我找到了几个工具,但主要是用于 Windows...
您是否有使用以下工具和 Novell SLES 服务器的经验?
- lumension 的Patchlink
- IBM 的 Tivoli Provision Manager
- Bigfix
- HP Server Automation
- BMC Bladelogic
- CA Spectrum Automation Manager

保持更新的数据中心由大约 600 台真实和虚拟服务器组成,主要运行 SLES 版本 10(但也存在 SLES 9)。

我认为 SMT 可以完成大部分工作,但在报告和库存方面似乎不足。你知道这些方面的补充工具吗?

感谢您的任何建议。

novell automation provisioning patch-management sles
  • 2 个回答
  • 1180 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