{"id":2873,"date":"2012-04-02T18:23:21","date_gmt":"2012-04-02T10:23:21","guid":{"rendered":"http:\/\/jpuyy.com\/?p=2873"},"modified":"2023-05-07T00:58:22","modified_gmt":"2023-05-06T16:58:22","slug":"do-not-cache-svn-password-on-disk","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=2873","title":{"rendered":"\u4e0d\u628asvn\u8ba4\u8bc1\u4fdd\u5b58\u5728\u672c\u673a"},"content":{"rendered":"<p>Caching passwords on disk?That&#8217;s terrible!You should never do that!\u201dSubversion<\/p>\n<p>\u5f00\u53d1\u8005\u8ba4\u8bc6\u5230\u8fd9\u79cd\u62c5\u5fc3\u7684\u5408\u7406\u6027\uff0c\u6240\u4ee5 Subversion \u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u548c\u73af\u5883\u63d0\u4f9b\u7684\u673a\u5236\u6765\u51cf\u5c11\u6cc4\u9732\u8fd9\u4e9b\u4fe1\u606f\u7684\u98ce\u9669\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u5728\u5927\u591a\u6570\u5e73\u53f0\u4e0a\u7684\u505a\u6cd5\uff1a<\/p>\n<p>windows\u5e73\u53f0\uff1a<\/p>\n<p>On Windows,the Subversion client stores passwords in the <code>%APPDATA%\/Subversion\/auth\/<\/code> directory.<\/p>\n<p>On Windows 2000 and later,the standard Windows cryptography services are used toencrypt the password on disk.Because the encryption key is managed by Windows and is tied tothe user&#8217;s own login credentials,only the user can decrypt the cached password.(Note that if the user&#8217;s Windows account password is reset by an administrator,all of the cached passwords becomeundecipherable.The Subversion client will behave as though they don&#8217;t exist,prompting forpasswords when required.)<\/p>\n<p>Mac OS\u5e73\u53f0\uff1a<\/p>\n<p>Similarly,on Mac OS X,the Subversion client stores all repository passwords in the login keyring(managed by the Keychain service),which is protected by the user&#8217;s account password.Userpreference settings can impose additional policies,such as requiring that the user&#8217;s account passwordbe entered each time the Subversion password is used.<\/p>\n<p>\u7c7bunix\u5e73\u53f0\uff1a<\/p>\n<p>For other Unix-like operating systems,no standard \u201ckeychain\u201dservices exist.However,the Subversionclient knows how to store password securely using the \u201cGNOME Keyring\u201dand \u201cKDE Wallet\u201dservices.Also,before storing unencrypted passwords in the ~\/.subversion\/auth\/caching area,theSubversion client will ask the user for permission to do so.Note that the auth\/caching area is stillpermission-protected so that only the user (owner)can read data from it,not the world at large.The operating system&#8217;s own file permissions protect the passwords from other non-administrativeusers on the same system,provided they have no direct physical access to the storage media of thehome directory,or backups thereof.Of course,for the truly paranoid,none of these mechanisms meets the test of perfection.So forthose folks willing to sacrifice convenience for the ultimate in security,Subversion provides variousways of disabling its credentials caching system altogether.<\/p>\n<p>\u4f60\u53ef\u4ee5\u5173\u95ed\u51ed\u8bc1\u7f13\u5b58\uff0c\u53ea\u9700\u8981\u4e00\u4e2a\u7b80\u5355\u7684\u547d\u4ee4\uff0c\u4f7f\u7528\u53c2\u6570&#8211;no-auth-cache\uff1a<\/p>\n<p>$svn commit -F log_msg.txt &#8211;no-auth-cacheAuthentication realm:&lt;svn:\/\/host.example.com:3690&gt;example realmUsername:joePassword for &#8216;joe&#8217;:Adding newfileTransmitting file data .<\/p>\n<p>\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u7981\u7528\uff1a<br \/>\nOr,if you want to disable credential caching permanently,you can edit the config file in yourruntime configuration area and set the store-auth-creds option to no.This will prevent thestoring of credentials used in any Subversion interactions you perform on the affected computer.Thiscan be extended to cover all users on the computer,too,by modifying the system-wide runtimeconfiguration area (described in \u7b2c 1.1 \u8282 \u201c\u914d\u7f6e\u533a\u5e03\u5c40\u201d).<\/p>\n<p>[auth]store-auth-creds =no<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Caching passwords on disk?That&#8217;s terrible!You should never do that!\u201dSubversion \u5f00\u53d1\u8005\u8ba4\u8bc6\u5230\u8fd9\u79cd\u62c5\u5fc3\u7684\u5408\u7406\u6027\uff0c\u6240\u4ee5 Subversion \u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u548c\u73af\u5883\u63d0\u4f9b\u7684\u673a\u5236\u6765\u51cf\u5c11\u6cc4\u9732\u8fd9\u4e9b\u4fe1\u606f\u7684\u98ce\u9669\u3002 \u4e0b\u9762\u662f\u5728\u5927\u591a\u6570\u5e73\u53f0\u4e0a\u7684\u505a\u6cd5\uff1a windows\u5e73\u53f0\uff1a On Windows,the Subversion client stores passwords in the %APPDATA%\/Subversion\/auth\/ directory. On Windows 2000 and later,the standard Windows cryptography services are used toencrypt the password on disk.Because the encryption key is managed by Windows and is tied tothe user&#8217;s own login credentials,only [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-2873","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2873"}],"version-history":[{"count":8,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2873\/revisions"}],"predecessor-version":[{"id":9803,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/2873\/revisions\/9803"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}