[Mono-dev] Data protection failed. ---> System.UnauthorizedAccessException: Access to the path "/usr/share/.mono/keypairs/

Jacek Rużyczka stacheldraht at interia.pl
Sat Oct 7 13:58:01 UTC 2017


Hi!

Am Samstag, den 07.10.2017, 17:36 +0530 schrieb nikhil sehgal:
> 
> HI All ,
> 
> > > While calling
ProtectedData.Protect(Encoding.Unicode.GetBytes("XXXXXXXXXXXXXXX"),
null, DataProtectionScope.LocalMachine);
> 
> 
> > I am getting following error ....i am running my application under
fast_cgi_mono+nginx and running as non root user..
> 
> And following error is coming randomly not always.
> 
> I don't want to run my application as root user for Security reasons
> .please advice
> 
> > > > System.Security.Cryptography.CryptographicException: Data protection
failed. ---> System.UnauthorizedAccessException: Access to the path
"/usr/share/.mono/keypairs/[1][98f3a7e3-0d6e-f432-8a18-
e1144b53633f][-1].xml" is denied.
>  
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
I would say your error is not related to Mono, but to the access
privileges on your machine. Please look into the privilege settings of
the file which causes the error. If it looke somehow like -rw-------,
only root and nobody else can read and write it. Then you'll have to
change it to -rw-r--r--, so that an ordinary user can at least read it,
and retry.

A cleaner solution, however, would be to generate a separate keypair
for each user and store it in $HOME/.mono/keypairs, so that you won't
run into privilege issues.

Regards
Jacek Rużyczka

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-devel-list/attachments/20171007/469b2bad/attachment-0001.html>


More information about the Mono-devel-list mailing list