gpt4 book ai didi

linux - Linux 中的密码

转载 作者:太空宇宙 更新时间:2023-11-04 05:05:50 25 4
gpt4 key购买 nike

我需要逻辑。我们将使用命令“passwd”来更改当前用户的密码。或者将使用“passwd user_name”来更改相应用户的密码。密码相关详细信息存储在/etc/shadow 文件中。我想我是对的。

我的疑问是 1. 每当用户的密码更改时,/etc/shadow 文件是否会更新? 2. 密码创建是否遵循任何加密方法? 3、如果有算法遵循,我们能否逆向算法找到用户的原始密码? 4. 是否还有其他文件包含有关 linux 密码的详细信息?

最佳答案

1) Whenever a user's password is changed, does the /etc/shadow file is updated?

是的,/bin/passwd程序是root权限的,所以无论谁运行它都会以root权限运行它,因此能够编辑影子文件。

2) Does the passowrd creation follow any encryption method?

如果您的意思是影子文件中的密码是否以某种方式被混淆,那么是的,它是经过哈希处理的。可能是 MD5 或 SHA(也可能是河豚),具体取决于您的 Linux 系统的发行版和年龄。

3) If there is any algorithm followed, can we reverse the algorithm and find the original password for a user?

该算法是尝试猜测密码,对其进行哈希处理,并将其与影子文件中的内容进行比较。这是蛮力,可能需要很长时间(参见“开膛手约翰”)。尽管存在某些可利用的哈希值,人们可以利用,但可能仅在非常特定的情况下,而不是您通常可以做的事情。

4) Is there any other file which holds details regarding the password of linux?

/etc/passwd 但它不保存哈希值。除非 PAM 使用其他内容(例如 LDAP),否则不应在任何其他位置存储密码。但大多数发行版的默认安装都使用影子文件。

关于linux - Linux 中的密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13582799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com