How to hide password when connecting to a shared folder using a non-windows account.

From my website. I need to allow user to be able to delete files from a shared folders.  How do I impersonate a non-windows account? I need to connect to a multiple Linux shared folder. so I do not want to map a drive letter. I currently use the below command, but I do not want to show my user name and password. I'm able to get the command below to work with impersonate with my windows account but .net impersonate does not work on non-windows accounts.  I need a solution that will let me connect to a shared folder using a non-windows account.

Example: I'm using the .Net ProcessStartInfo.Arguments Property

startInfo.FileName = "net";
startInfo.Arguments = "use \\\\Servername\serverPath serverPassword /user:serverUsername";
Process.Start(startInfo);
rich brownAsked:
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.

Gustav BrockCIOCommented:
I need a solution that will let me connect to a shared folder using a non-windows account.

You can't do that without a password - as exemplified in your code.
But you could store the password (and username) encrypted (using SHA or similar) and only decrypt it on the fly to not have it stored or displayed in clear text:

startInfo.Arguments = "use \\\\Servername\serverPath " + GetserverPassword + " /user:" + GetserverUsername + "";

Open in new window

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
ASP.NET

From novice to tech pro — start learning today.