What is the folder location of certificate store in win10? - windows

What is the folder path of the certificate store in windows? Meaning, in powershell, I can do something like cd cert:\localmachine, is there a way to navigate to this path via file explorer?
My situation: I deleted some cert from localmachine cert store. This included a cert used by windows for login. Because of that I got locked out of that machine. I mounted the hard drive from the locked out vm to another vm and now I can access the files, including the backup of certs I exported before deleting. My goal is to install cert from that backup to the cert store that lies somewhere in the mounted hard drive. The challenge is I haven't been able to figure where the cert store is located in the hard drive to specify it as a part of import-certificate cmdlet.
In powershell, I am doing something like
import-certificate -filepath d:\users\xxxx\desktop\backup.pfx --certstorelocation whatGoesHere
for the --certstorelocation, if I use cert:\localmachine\, the certificates are going to be installed to the current os, which is not my goal. I want to be able to specify path to cert store that is somewhere in my mounted harddrive.

There is no way to use custom cert store path in Windows, you should import certifates to existing cert stores.
Check Import-Certificate
cd cert:
PS Cert:\> ls
Location : CurrentUser
StoreNames : {TrustedPublisher, ClientAuthIssuer, Root, TrustedDevices...}
Location : LocalMachine
StoreNames : {TestSignRoot, ClientAuthIssuer, OemEsim, WindowsServerUpdateServices...}
PS Cert:\> cd .\\LocalMachine\
PS Cert:\LocalMachine\> ls
PS Cert:\LocalMachine\> cd .\Root\
Thats it :)

Related

Location of ~/.git-credentials file in Windows 10?

I searched but couldn't find the path of ~/.git-credentials in my Windows 10 machine. git documentation says that it stores username and password in plain-text in ~/.git-credentials. I want to verify it by opening the file manually.
On windows 10, git user credentials are now stored with the Credential Manager.
It is located at %UserProfile%\.git-credentials, which corresponds to C:\Users\<username>\.git-credentials (unless you've modified the registry to move your user's profile directory elsewhere).
Generally, ~ refes to the user's home directory on Linux, and many cross-platform tools which store data in ~ on Linux (including git) store their data in the user's home directory on Windows as well.

How to copy files from remote server's share drive to my local computer using Ant

How to copy files from remote server's share drive to my local computer using an Ant script?
What I do currently is
Open Windows explorer
Type the location of the folder (like //192.168.2.12/xyz/abc)
Ask for credentials, I provide those
copy the file and paste it on the local server
I want to perform the same things through an Ant script.

Connect to shared folder with username and password and copy files to that folder

I wanted to connect to a shared folder with user name and a password. After the connection is successful copy files to destination folder.
I know using "net use" command a shared folder can be mapped to a drive and after that I can use, I do not wanted to do that.
I am doing this to create a script to deployment a dotnet web application.
Any kind of help is highly appreciated.
Note: powershell is not available in that server.
Thanks
Use net use z: \\<network-location>\<some-share>\ password /USER:username first and then net /d z: to clean up, if your primary concern is not to leave unnecessary shares. Unfortunately, you cannot include your credentials in any other standard CLI command.

Access KeyChain from PackageMaker

Is it possible to store certificates into the key chain as part of installation created with PackageMaker? I would like to provide an installation which inserts the certificates into the key chain on Mac OS X.
I've founded the solution for importing certificates as a part of installation.
The solution includes performing following steps:
add certs folder (contains the certificates we wish to import) into the installation. The certs folder is extracted on the specified path (defined as CERT_PATH variable)
create a shell script (also included into the installation to be extracted), which performs the import of certificates into the keychain. The script looks similar to:
CERT_PATH = "/Applications/MyApp/certs"
security add-certificates $CERT_PATH/mycert1.crt
security add-certificates $CERT_PATH/mycert2.crt
The script is called postflight (more about Package Maker and scripts at Using PackageMaker to run a script on install)

Linux equivalent for the Windows certificate store

Is there any fixed or known location for storing certificates in Linux, something like the Windows certificate store?
Thanks.
Yes, for system certificates, use
/etc/ssl/certs
AND
/etc/ssl/private (chmod 700)
For user SSH keys use the user's home folder, in a hidden folder named .ssh.
/home/user/.ssh
OR
~/.ssh
For webservers like apache, you can override the default location of certificates found in httpd.conf.

Resources