How to read a efs enabled text file

Hi,

I have a requirement where i will store a password in a text file and enable EFS on the file using a domain account A. Now i have a perl script which will read the encryped text file to get the password and set the service account password on remote machines. Issue is that same domain account A is not able to read the file through the script functions but could open directly from the windows explorer.

Is there a way to read the contents of the encrypted text file using the same domain account with which its encrypted? This script is a bit critical for our product release but couldn't find a way to proceed.

Thanks
LVL 1
deshawAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TolomirAdministratorCommented:
Did you check if that perl script runs as that particular user (i.e. with his credentials)

0
deshawAuthor Commented:
Hi,

Thanks for the response. Yes its running using same user. I encrypted the file using my login running the script using my login itself.

Thanks
0
TolomirAdministratorCommented:
You could test if you set the permissions just for that account disable all others like System, Administrators and such for that single textfile - then disable EFS for that file - run that script.

When everything runs proper you should get your password. -> Then it's really an EFS issue.

0
Redefining Cyber Security w/ AI & Machine Learning

The implications of AI and machine learning in cyber security are massive and constantly growing, creating both efficiencies and new challenges across the board. Join our webinar on Sept. 21st to learn more about leveraging AI and machine learning to protect your business.

Adam314Commented:
What happens when the perl script tries to read the file?  Does it fail on the open statement?  What is the error ($!)?  Does it fail on the read?
0
deshawAuthor Commented:
I verified using NTFS permissions and its works fine but as soon as i enabled EFS on the text file it starts throwing error in my script.

My script fails with message can't open the file c:\local\...txt

Thanks
0
Adam314Commented:
You don't get a reason it can't open the file?  Are you printing $!?

Something like this:

open(IN, "<", $file) or die "Could not open file $file because $!\n";

Open in new window

0
deshawAuthor Commented:
I get below message when i try to open the file.

INFO:  can't read c:\local\passwd\passwd.txt

readline() on closed filehandle FILE at C:\local\set-service.pl line 268
0
Adam314Commented:
It sounds like the open failed, but didn't display an error message.
Can you post the set-service.pl file - or at least the relavant portions?
0
deshawAuthor Commented:
Good news is that EFS perl module is helping to achieve this. Will let you know the details once it works.
0
deshawAuthor Commented:
hmm...we could actually read the files normally. When we logged this request, we were trying to open the file in a Runas window which was failing to open the files. Normally its opening.

Sorry for the trouble.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Encryption

From novice to tech pro — start learning today.