PermitRootLogin是基于UID还是用户名?

PermitRootLogin是基于UID还是用户名?Sometimesitisfuntodigabitdeeperintohowthingsworkjusttosatisfyyourcuriositywhilelearningsomethingnew,likePermitRootLogin,forexample.DoesitchecktheUIDortheusername?Tod…

大家好,又见面了,我是你们的朋友全栈君。

is-permitrootlogin-based-on-the-uid-or-the-user-name-00

Sometimes it is fun to dig a bit deeper into how things work just to satisfy your curiosity while learning something new, like PermitRootLogin, for example. Does it check the UID or the user name? Today’s SuperUser Q&A post digs in to find the answer to a curious reader’s question.

有时,在学习诸如PermitRootLogin之类的新知识的同时,更深入地研究事物的工作方式只是为了满足您的好奇心是很有趣的。 是否检查UID或用户名? 今天的“超级用户问答”帖子深入探讨了对好奇的读者问题的答案。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader ge0rg wants to know if PermitRootLogin is based on the UID or the user name:

超级用户阅读器ge0rg想知道PermitRootLogin是基于UID还是用户名:

The man page states that PermitRootLogin:

手册页指出PermitRootLogin

  • Specifies whether root can log in using ssh(1).

    指定root是否可以使用ssh(1)登录。

However, it is not clear if this check is based on the user name (root) or the UID (0). What happens if the root account is renamed to admin? Will admin be able to log in when PermitRootLogin=no? What happens if there are two accounts with UID=0 (i.e. root and admin)? Will either of them be able to log in?

但是,尚不清楚此检查是基于用户名( root )还是UID( 0 )。 如果将根帐户重命名为admin会怎样? 当PermitRootLogin = no时, 管理员能够登录吗? 如果有两个UID = 0的帐户(即rootadmin ),会发生什么情况? 他们两个都可以登录吗?

Is PermitRootLogin based on the UID or the user name?

PermitRootLogin是基于UID还是用户名?

答案 (The Answer)

SuperUser contributor mtak has the answer for us:

超级用户贡献者mtak为我们提供了答案:

It seems the check is done with the UID (tested on OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016):

似乎检查是通过UID完成的(已在OpenSSH_6.7p1 Debian-5 + deb8u3,OpenSSL 1.0.1t(2016年5月3日进行了测试 )):

Set PermitRootLogin to Off:

PermitRootLogin设置为Off:

is-permitrootlogin-based-on-the-uid-or-the-user-name-01

Make sure a user named admin is created with UID 0:

确保使用UID 0创建名为admin的用户:

is-permitrootlogin-based-on-the-uid-or-the-user-name-02

Make sure the user can be used to log in to the system:

确保可以使用该用户登录系统:

is-permitrootlogin-based-on-the-uid-or-the-user-name-03

Check to see if we can log in to the system using SSH:

检查我们是否可以使用SSH登录到系统:

is-permitrootlogin-based-on-the-uid-or-the-user-name-04

If we set PermitRootLogin back to On:

如果我们将PermitRootLogin设置回On:

is-permitrootlogin-based-on-the-uid-or-the-user-name-05

And try to log in:

并尝试登录:

is-permitrootlogin-based-on-the-uid-or-the-user-name-06


Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

Image Credit: Linux Screenshots/Xmodulo (Flickr/Xmodulo)

图片来源:Linux屏幕截图/ Xmodulo( Flickr / Xmodulo )

翻译自: https://www.howtogeek.com/271272/is-permitrootlogin-based-on-the-uid-or-the-user-name/

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/144059.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)
blank

相关推荐

  • 网络访问控制列表ACL(读懂这篇就基本够了,后面有配置案例)[通俗易懂]

    网络访问控制列表ACL(读懂这篇就基本够了,后面有配置案例)[通俗易懂]一、访问控制列表是什么?访问控制列表(ACL)是一种基于包过滤的访问控制技术,它可以根据设定的条件对接口上的数据包进行过滤,允许其通过或丢弃。访问控制列表被广泛地应用于路由器和三层交换机,借助于访问

  • 基于Java swing+mysql+eclipse的【图书管理系统】

    基于Java swing+mysql+eclipse的【图书管理系统】一、效果演示:主要功能:①基本数据维护:图书类别管理>>图书类别添加、图书类别维护图书管理>>图书添加、图书维护②关于我们1、登录界面2、主界面:3、图书类别维护4、图书类别添加5、图书维护6、图书添加7、关于我们可全部缩小到左下角二、核心代码:1、Util包【存放数据库连接工具】①DBTool(数据库连接工具类)packagecn.ac.azure.util;importjava.io.IOException

  • 电脑爱好者GHOSTWIN7纯净版V1.0[通俗易懂]

    电脑爱好者GHOSTWIN7纯净版V1.0[通俗易懂]系统特点:全自动无人值守安装,采用万能GHOST技术,安装系统过程只需5-8分钟,适合新旧各种机型。集成常见硬件驱动,智能识别+预解压技术,绝大多数硬件可以快速自动安装相应的驱动。DirectX_9.0cVC++2005|2008|2010|2012|201…

  • 2021-08-16 WPF控件专题 WrapPanel 控件详解

    2021-08-16 WPF控件专题 WrapPanel 控件详解1.WrapPanel控件介绍流面板子元素按顺序排列,如果按水平方向:从左到右,超出部分,自动换行到下一行垂直从上到下,下一列排列方向:OrientationItemWidthItemHeight调整面板的尺寸时,内部子元素的布局–自动调整弥补StackPanel的不足StackPanel与WrapPanel结合使用2.具体案例<BorderBorderBrush=”Red”BorderT.

  • 下载verycd的方法下载电驴资源隐藏资源的最新可用方法

    下载verycd的方法下载电驴资源隐藏资源的最新可用方法我也是刚听说,现在电驴也不让下载了,和以前的狗狗一样,资源都屏蔽了,今天无意得到了一个可以下载电驴上的资源的方法,很简单,应该是漏洞,不知道能用多久,但是目前至少可以用。自2012年8月30日之后,verycd上所有资源的ed2k下载链接均被隐藏。没有登录的会员会显示“该资源为版权方声明保护内容,VeryCD不提供其下载”的字样。仅高等级的用户才能正常浏览到资源的e

  • 网络安全工具使用集锦手册下载_网络安全科普书籍

    网络安全工具使用集锦手册下载_网络安全科普书籍常用工具:Nmap使用详解 Sqlmap使用详解 CobaltStrike的使用 MetasploitFramework(MSF)的使用 CobaltStrike上线微信提醒 CobaltStrike的argue参数污染绕AV CobaltStrike证书修改躲避流量审查 CobaltStrike上线Linux主机(CrossC2)域内工具:Linux下使用ldapsearch进行域信息查询 ADExplorer和TheLDAPExplorer工具的用法 ADSI(Act

    2022年10月19日

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号