The SSH folder stores your per-user SSH settings and, often, your key files. It is usually a hidden folder named .ssh inside your home directory, but its exact location depends on your operating system and which SSH environment you use. Follow the steps below to find it, check whether it exists, and open it without exposing private keys.
What You’ll Need
- Access to the computer account that uses SSH.
- File Explorer or Finder, or a terminal such as Terminal, PowerShell, Command Prompt, or a Linux shell.
- The name of the environment you use, if relevant. Windows OpenSSH, Git Bash, and Windows Subsystem for Linux (WSL) can use different home directories.
You do not need to be connected to a server to locate the folder. Avoid opening or sharing private-key files while you look around.
Step-by-Step
-
Identify the operating system and SSH environment. On macOS or Linux, the usual location is
~/.ssh. For Windows OpenSSH, it is usuallyC:\Users\YourName\.ssh, whereYourNameis your Windows account name. If you use WSL, you have a separate Linux home directory and a separate.sshfolder there. Git Bash generally uses your Windows user profile, but check the path from the same terminal you use to run SSH. -
Try the file manager first if you prefer a visual route. On macOS, open Finder, choose Go and then Home. Press Command-Shift-Period to show hidden files and folders; look for
.ssh. On Windows, open File Explorer and enter%USERPROFILE%\.sshin the address bar. If that does not open the folder, go to your user folder, such asC:\Users\Alex, and turn on View > Show > Hidden items. The exact menu wording can vary by Windows version. -
Locate it from macOS or Linux Terminal. Open Terminal and run
ls -la ~/.ssh. The-aoption includes hidden entries, and-lshows details. If the folder exists, the command lists its contents. To move into it, runcd ~/.ssh; to print the full path, runpwd. The tilde character (~) means your current account’s home directory, not the root of the computer. -
Check for the folder in Windows PowerShell. Open PowerShell and run
Test-Path $HOME\.ssh. A result ofTruemeans that path exists;Falsemeans it does not. To list the folder, runGet-ChildItem -Force $HOME\.ssh. The-Forceoption includes hidden entries. To display the full home-directory path, run$HOME. In Command Prompt, you can check withdir /a %USERPROFILE%\.ssh. -
Check the environment you actually use on Windows. WSL has its own Linux home, so open the relevant WSL distribution and run
ls -la ~/.sshthere. That folder is commonly under/home/your-linux-name/.ssh, not the Windows profile folder. In Git Bash, runls -la ~/.sshin Git Bash itself. Its home directory may map to your Windows profile, but a customized home setting can change that. Do not assume that a folder found in one terminal is the one another SSH client reads. -
If the folder is missing, decide whether you need to create it. A missing
.sshfolder is normal if you have not used SSH from that account or environment. You do not need to create it just to confirm that it is absent. If you are setting up SSH and need a place for your user configuration or keys, create it on macOS or Linux withmkdir -p ~/.ssh. In PowerShell, useNew-Item -ItemType Directory -Force $HOME\.ssh. These commands create the folder under the current account’s home directory. -
Set appropriate permissions on macOS or Linux. If you created the folder or SSH reports that its permissions are too open, run
chmod 700 ~/.ssh. This allows your account to access the folder while limiting access for other users. A private key, such asid_ed25519, usually needs stricter permissions:chmod 600 ~/.ssh/id_ed25519. Do not apply that command blindly to every file; public-key files ending in.pubare not private keys. Windows uses a different permissions model, so do not use the Unixchmodinstructions in PowerShell. -
Recognize the files without revealing sensitive information. Common contents include
config, which holds per-user SSH client settings; a private key such asid_ed25519; its corresponding public key,id_ed25519.pub; andknown_hosts, which records server host keys. Filenames vary, and an empty folder can still be a valid SSH folder. You can inspect filenames with a directory listing, but never paste a private key’s contents into a chat, email, website, or support ticket. -
Check for a custom location if the expected folder is not being used. SSH clients can be configured with a different home directory, key path, or configuration file. In macOS or Linux,
echo $HOMEprints the home directory used by that shell; in PowerShell,$HOMEdoes the same. Check the command or application you use to connect, and look for options that specify an identity file or alternate configuration file. If a command includes a custom key path, the key may be outside.ssheven though the usual folder exists.
Common Mistakes
A frequent mistake is treating .ssh as an ordinary visible folder. The leading dot makes it hidden on macOS and Linux, so a basic ls may not show it; use ls -a or ls -la. On Windows, enable hidden items in File Explorer or use a command that includes hidden entries.
Another common mix-up is confusing the SSH program with its data folder. The SSH executable may live in a system directory, while your user files live in ~/.ssh. Finding ssh with a command such as which ssh does not show where your keys are stored. Also, do not search only for a file called id_rsa: newer keys often use another name, and users can choose custom filenames.
Finally, do not confuse your local folder with the server’s SSH files. Your computer’s .ssh folder is not automatically the same as a remote account’s ~/.ssh directory. A server’s authorized_keys file is on that server, unless you are specifically logged into it and inspecting its home directory.
Tips
- Use the same account and terminal. A personal account, administrator account, WSL distribution, and Git Bash shell can each resolve a different home directory.
- Copy the path rather than guessing. Use
pwdafter entering the folder on macOS or Linux, or$HOMEin PowerShell, to confirm the location. - Keep private keys private. A file without a
.pubsuffix is often a private key, though names can vary. Treat it as secret unless you have verified otherwise. - Back up carefully. If you need to preserve SSH access, store private-key backups in a secure, encrypted place. Do not put them in a public repository or an unprotected shared folder.
- Remember that files can be elsewhere. An SSH configuration file can point to a key outside
.ssh, and some applications manage their own keys. The folder is the common default, not a guarantee.
Troubleshooting
The command says the path does not exist. First check your home directory with echo $HOME on macOS or Linux, or $HOME in PowerShell. Then check the spelling and try listing the home directory itself, for example ls -la ~ or Get-ChildItem -Force $HOME. If .ssh is not listed, it may simply not have been created. Create it only if your SSH setup needs it.
File Explorer says the location cannot be found. Confirm that you are signed into the expected Windows account and that the profile path is correct. Open %USERPROFILE% first, then check whether a hidden .ssh folder is present. If you use WSL or Git Bash, inspect the home directory from that environment rather than relying on the Windows profile path.
You can see the folder but cannot open or list it. Check that you are using the account that owns it. On macOS or Linux, inspect permissions with ls -ld ~/.ssh; do not change ownership or permissions with elevated privileges unless you understand the consequences. If you created the directory as another user, correct its ownership using an administrator only when necessary. On Windows, check the folder’s Security properties and make sure your account has access.
SSH still cannot find a key. Finding the folder does not prove that a key exists or that your client is using it. List filenames, check the SSH configuration and the command’s options, and verify that you are running the same SSH client and account that you used when creating the key. Never solve a key-location problem by making a private key readable to everyone.
The folder appears empty. That can be expected if no keys or configuration have been created in this environment. A key stored by a different account, WSL distribution, or application will not necessarily appear there. If you need a key, follow the setup instructions for your SSH client and save it to a location you can identify and protect.
Frequently Asked Questions
Where is the SSH folder on Mac?
For your current macOS account, it is usually /Users/your-name/.ssh, also written as ~/.ssh. In Finder, open your home folder and press Command-Shift-Period to reveal hidden items.
Where is the SSH folder in Windows 10 or 11?
For Windows OpenSSH, the usual path is C:\Users\your-name\.ssh. Enter %USERPROFILE%\.ssh in File Explorer, or check it in PowerShell with Test-Path $HOME\.ssh.
Why do I not have an SSH folder?
It is usually created when an SSH key or user configuration is first saved. If you have not used SSH in that account or environment, it may not exist. Create it only when you are setting up SSH and need the directory.
Is the SSH folder the same as the folder containing the SSH program?
No. The program is an installed executable, while .ssh is a per-user folder for settings and commonly used keys. They are normally in different locations.
Can I share the files in my SSH folder?
Do not share private keys or copy their contents into messages. A public key ending in .pub is designed to be shared when setting up access, but confirm which file you have before sending it. Keep configuration and known-host information private when it could reveal sensitive details.