Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 相同的文件内容但不同的md5sum值?_File - Fatal编程技术网

File 相同的文件内容但不同的md5sum值?

File 相同的文件内容但不同的md5sum值?,file,File,我发现了一个奇怪的问题。 pam未正确读取common-account.puppet pam可以正确读取common-account.write 但是,使用meld和vimdiff,它们的文本是相同的 md5sum common-account.puppet common-account.written 7e80513f6dc8f7604ec36dbf6248780d common-account.puppet 47425f79f81d38eadbadb0c3de89aafc common

我发现了一个奇怪的问题。 pam未正确读取common-account.puppet pam可以正确读取common-account.write

但是,使用meld和vimdiff,它们的文本是相同的

md5sum  common-account.puppet common-account.written
7e80513f6dc8f7604ec36dbf6248780d  common-account.puppet
47425f79f81d38eadbadb0c3de89aafc  common-account.written
我不知道两者之间有什么区别。有显示更多差异日志的命令吗

kithokit@15:46:58 ~ $ md5sum common-account.puppet common-account.written 
7e80513f6dc8f7604ec36dbf6248780d  common-account.puppet
47425f79f81d38eadbadb0c3de89aafc  common-account.written
kithokit@15:47:08 ~ $ diff common-account.puppet common-account.written
1,29c1,29
< #
< # /etc/pam.d/common-account - authorization settings common to all services
< #
< # This file is included from other service-specific PAM config files,
< # and should contain a list of the authorization modules that define
< # the central access policy for use on the system.  The default is to
< # only deny service to users whose accounts are expired in /etc/shadow.
< #
< # As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
< # To take advantage of this, it is recommended that you configure any
< # local modules either before or after the default block, and use
< # pam-auth-update to manage selection of other modules.  See
< # pam-auth-update(8) for details.
< #
< 
< # here are the per-package modules (the "Primary" block)
< account sufficient    pam_winbind.so
< account required     pam_unix.so
< 
< #account    [success=2 new_authtok_reqd=done default=ignore]    pam_unix.so 
< #account    [success=1 new_authtok_reqd=done default=ignore]    pam_winbind.so 
< # here's the fallback if no module succeeds
< #account    requisite            pam_deny.so
< # prime the stack with a positive return value if there isn't one already;
< # this avoids us returning an error just because nothing sets a success code
< # since the modules above will each just jump around
< #account    required            pam_permit.so
< # and here are more per-package modules (the "Additional" block)
< # end of pam-auth-update config
---
> #
> # /etc/pam.d/common-account - authorization settings common to all services
> #
> # This file is included from other service-specific PAM config files,
> # and should contain a list of the authorization modules that define
> # the central access policy for use on the system.  The default is to
> # only deny service to users whose accounts are expired in /etc/shadow.
> #
> # As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
> # To take advantage of this, it is recommended that you configure any
> # local modules either before or after the default block, and use
> # pam-auth-update to manage selection of other modules.  See
> # pam-auth-update(8) for details.
> #
> 
> # here are the per-package modules (the "Primary" block)
> account sufficient    pam_winbind.so
> account required     pam_unix.so
> 
> #account    [success=2 new_authtok_reqd=done default=ignore]    pam_unix.so 
> #account    [success=1 new_authtok_reqd=done default=ignore]    pam_winbind.so 
> # here's the fallback if no module succeeds
> #account    requisite            pam_deny.so
> # prime the stack with a positive return value if there isn't one already;
> # this avoids us returning an error just because nothing sets a success code
> # since the modules above will each just jump around
> #account    required            pam_permit.so
> # and here are more per-package modules (the "Additional" block)
> # end of pam-auth-update config
kithokit@15:46:58 ~$md5sum common-account.puppet common-account.writed
7e80513f6dc8f7604ec36dbf6248780d通用账户.puppet
47425F79F81D38EADBB0C3DE89AAFC通用帐户。已写入
kithokit@15:47:08 ~$diff common-account.puppet common-account.write
1,29c1,29
< #
<#/etc/pam.d/common-account-所有服务通用的授权设置
< #
<#此文件包含在其他特定于服务的PAM配置文件中,
<#并应包含定义
<#系统上使用的中央访问策略。默认设置是
<#仅拒绝向在/etc/shadow中帐户过期的用户提供服务。
< #
<#从pam 1.0.1-6开始,默认情况下,该文件由pam auth update管理。
<#为了利用这一点,建议您配置
<#本地模块在默认块之前或之后,并使用
<#pam auth update以管理其他模块的选择。看见
<#pam auth update(8)了解详细信息。
< #
< 
<#以下是每包模块(“主”块)
 #
>#/etc/pam.d/common-account-所有服务通用的授权设置
> #
>#此文件包含在其他特定于服务的PAM配置文件中,
>#并应包含定义
>#系统上使用的中央访问策略。默认设置是
>#仅拒绝向在/etc/shadow中帐户过期的用户提供服务。
> #
>#从pam 1.0.1-6开始,默认情况下,该文件由pam auth update管理。
>#为了利用这一点,建议您配置
>#本地模块在默认块之前或之后,并使用
>#pam auth update以管理其他模块的选择。看见
>#pam auth update(8)了解详细信息。
> #
> 
>#以下是每包模块(“主”块)
>帐户足够pam_winbind.so
>所需帐户pam_unix.so
> 
>#account[success=2 new_authtok_reqd=done default=ignore]pam_unix.so
>#account[success=1 new_authtok_reqd=done default=ignore]pam_winbind.so
>#如果没有模块成功,这里是备用方案
>#账户要求pam#u deny.so
>#如果还没有返回值,则使用正返回值为堆栈加素数;
>#这避免了我们因为没有设置成功代码而返回错误
>#因为上面的模块每个都只是跳转
>#需要pam#U许可证的账户。so
>#这里有更多的每包模块(“附加”模块)
>#pam auth update config结束

感谢您提供帮助

文件外观相同,但7e80513f6dc8f7604ec36dbf6248780d是具有Windows EOL字符的文件,而47425F79F81D38EADBABDB0C3DE89AAFC是具有Unix EOL字符的同一文件

我们可以使用

vim -b <filename> 
vim-b
显示该文件是否有^M个字符

如果是,请手动将其删除或执行

dos2unix <filename>
dos2unix

换行符?unix/windows样式?如何检查是否存在换行符/或unix windows样式?是的,可能创建的其中一个文件是从windows文件复制和粘贴的。您如何知道以及如何更改为相同的?@KitHo
dos2unix
unix2dos
Linux实用程序。在Archlinux上,包
dos2unix
。不管怎样,UNIX EOL是
\n
,Windows'one是
\r\n
。是的,谢谢!省省我的痛苦吧。我只是想知道我不能在我的vim编辑器中显示^M字符verystrange@KitHo使用
-b
(二进制模式)选项启动vim。它将显示
^M
-s。