2013-05-16 60 views
0

我發現了一個奇怪的問題。 pam 無法正確讀取common-account.puppet pam可以正確讀取common-account.written。相同的文件內容但不同的md5sum值?

但他們的文字是一樣的,採用MELD和Vimdiff可以

md5sum common-account.puppet common-account.written 
7e80513f6dc8f7604ec36dbf6248780d common-account.puppet 
47425f79f81d38eadbadb0c3de89aafc common-account.written 

我不知道什麼是兩者之間的區別。任何顯示更多差異日誌的命令?

[email protected]:46:58 ~ $ md5sum common-account.puppet common-account.written 
7e80513f6dc8f7604ec36dbf6248780d common-account.puppet 
47425f79f81d38eadbadb0c3de89aafc common-account.written 
[email protected]: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 

謝謝如果你能幫助

+0

換行符? unix/windows風格? –

+0

我如何檢查是否有換行符/或unix windows風格? –

+0

也許,其中一個創建的文件是複製和粘貼從Windows文件 –

回答

2

這些文件看起來是一樣的,但7e80513f6dc8f7604ec36dbf6248780d與Windows EOL字符的文件,而47425f79f81d38eadbadb0c3de89aafc和Unix的EOL相同的文件。

我們可以使用

vim -b <filename> 

顯示,如果有^該文件字符M。

如果是的話,手動刪除它或者exec

dos2unix <filename> 
+0

你怎麼知道,我怎麼能改變相同? –

+1

@KitHo'dos2unix'和'unix2dos' Linux實用程序。在Archlinux上,打包'dos2unix'。無論如何,UNIX EOL是'\ n',Windows'是'\ r \ n'。 –

+0

是的謝謝!拯救我的痛苦。我只是想知道我不能在我的vim編輯器中顯示^ M字符非常有用 –

相關問題