Где лежит ssh на windows

After OpenSSH installs, perform some additional configuration steps.

Ensure that the OpenSSH folder is included on the system path environment variable:

C:\Windows\System32\OpenSSH\ if installed as the Windows optional feature
C:\Program Files\OpenSSH\ if installed via the OpenSSH download
Set the two services to start automatically:

# PowerShell Admin
# Config services sshd and ssh-agent
# for start automatic when logon
Set-Service sshd -StartupType Automatic
Set-Service ssh-agent -StartupType Automatic

If you installed OpenSSH with the optional feature, then Windows creates a new firewall rule to allow inbound access of SSH over port 22. If you installed OpenSSH from the download, then create the firewall rule with this command:

# PowerShell Admin
# Add FireWall Rules for OpenSSH Server
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' `
-Enabled True -Direction Inbound -Protocol TCP `
-Action Allow -LocalPort 22

Start the sshd service to generate the SSH keys:

# PowerShell Admin
Start-Service sshd

The SSH keys and configuration file reside in C:\ProgramData\ssh, which is a hidden folder. The default shell used by SSH is the Windows command shell. This needs to change to PowerShell:

# PowerShell Admin
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell `
-Value "C:\Program Files\PowerShell\6\pwsh.exe" -PropertyType String -Force

Now, when you connect to the system over SSH, PowerShell Core will start and will be the default shell. You can also make the default shell Windows PowerShell if desired.

There’s a bug in OpenSSH on Windows. It doesn’t work with paths with a space, such as the path to the PowerShell Core executable! The workaround is to create a symbolic link that creates a path that OpenSSH can use:

# PowerShell Admin
New-Item -ItemType SymbolicLink -Path C:\pwsh -Target 'C:\Program Files\PowerShell\6'

In the sshd_config file, un-comment the following lines:

PubkeyAuthentication yes
PasswordAuthentication yes

Add this line before other subsystem lines:

Subsystem  powershell C:\pwsh\pwsh.exe -sshs -NoLogo -NoProfile

This tells OpenSSH to run PowerShell Core.

Comment out the line:

AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

After saving the changes to the sshd_config file, restart the services:

# PowerShell Admin
Restart-Service sshd
Start-Service ssh-agent

You need to restart the sshd service after any change to the config file.

Open your Windows Explorer to check if the ./ssh directory already exists in your pc. Following this path should direct you there: C:\Users\[your user name]\. ssh (replace [your user name] with your user name).

How do I get to .ssh folder?

In the find file window, press Command-Shift-G. It’ll ask you what folder to navigate to. Enter ~/. ssh and press return.

How do I find ssh files?

Checking for existing SSH keys

  1. Open .
  2. Enter ls -al ~/. ssh to see if existing SSH keys are present. …
  3. Check the directory listing to see if you already have a public SSH key. By default, the filenames of supported public keys for GitHub are one of the following. …
  4. Either generate a new SSH key or upload an existing key.

How do I find my SSH key Windows 10?

  1. open command prompt (cmd)
  2. enter ssh-keygen and press enter.
  3. press enter to all settings. now your key is saved in c:\Users\. ssh\id_rsa. pub.
  4. Open your git client and set it to use open SSH.

Where is SSH public key in Windows?

pub from the file name (in any instance). Remember id_rsa is the private key and id_rsa. pub is the public key. And that’s all there is to viewing your SSH public and private keys on Linux, macOS, and Windows.

Learn SSH In 6 Minutes — Beginners Guide to SSH Tutorial

Where do I find my SSH public key?

By default, the private key is stored in ~/. ssh/id_rsa and the public key is stored in ~/. ssh/id_rsa.

What is the .SSH directory?

1. The . ssh directory is not by default created below your home directory. When you call ssh somehost (replace ‘somehost’ by the name or IP of a host running sshd), the directory and the file . ssh/known_hosts will be created.

How do I open an ssh file in Windows?

Start the service and/or configure automatic start:

  1. Go to Control Panel > System and Security > Administrative Tools and open Services. …
  2. If you want the server to start automatically when your machine is started: Go to Action > Properties. …
  3. Start the OpenSSH SSH Server service by clicking the Start the service.

How do I create a .ssh file in Windows?

Generating an SSH key

  1. Open the PuTTYgen program.
  2. For Type of key to generate, select SSH-2 RSA.
  3. Click the Generate button.
  4. Move your mouse in the area below the progress bar. …
  5. Type a passphrase in the Key passphrase field. …
  6. Click the Save private key button to save the private key.

Where is ssh config file on Windows 10?

For Windows, the default installation folder is %systemdrive%\Windows\System32\openssh. The following command shows the current path setting, and adds the default OpenSSH installation folder to it.

How do I create a .ssh file?

Generate an SSH Key Pair

  1. Run the ssh-keygen command. You can use the -t option to specify the type of key to create. …
  2. The command prompts you to enter the path to the file in which you want to save the key. …
  3. The command prompts you to enter a passphrase. …
  4. When prompted, enter the passphrase again to confirm it.

How do I find my SSH server?

How to Connect via SSH

  1. Open the SSH terminal on your machine and run the following command: ssh your_username@host_ip_address. …
  2. Type in your password and hit Enter. …
  3. When you are connecting to a server for the very first time, it will ask you if you want to continue connecting.

Can I delete SSH folder?

You can remove them, but I would err on the side of caution and leave them alone as they won’t do any harm or introduce any vulnerabilities — without the ssh or sshd binaries installed on your system having the leftover host ssh fingerprints and any leftover flat-file (text) configuration data in the folder is not …

Where are public and private keys stored?

Keys and certificates are stored in keystores and truststores. Private keys and personal certificates are stored in keystores. Public keys and CA certificates are stored in truststores. A truststore is a keystore that by convention contains only trusted keys and certificates.

How do I copy my SSH key?

Procedure

  1. In a terminal window, enter the following command: ssh-keygen -t rsa.
  2. Follow the prompts to generate the key. You must provide a file name and a passphrase. A public and a private key are generated. …
  3. Copy the public key to each node computer, by using the following command: ssh-copy-id username @ node_name.

Can I delete .SSH file?

Sometimes you would need to remove a file or a folder from the system. To do so using SSH, you would need to execute the appropriate command – rm. This will match all files starting with ‘myFile’ and ending in ‘. txt’ and delete them.

How do I uninstall SSH?

Delete SSH Key

  1. SSH to your server.
  2. Edit ~/. ssh/authorized_keys.
  3. Remove the line containing your key.
  4. Save and exit.

What is SSH add command?

The ssh-add command prompts the user for a private key password and adds it to the list maintained by ssh-agent . Once you add a password to ssh-agent , you will not be prompted for it when using SSH or scp to connect to hosts with your public key.

How do I know if SSH is installed?

How to check if SSH is running on Linux?

  1. First Check if the process sshd is running: ps aux | grep sshd. …
  2. Second, check if the process sshd is listening on port 22: netstat -plant | grep :22.

How do I connect to a SSH server in Windows?

Windows operating systems

  1. Start PuTTY.
  2. In the Host Name (or IP address) text box, type the hostname or IP address of the server where your account is located.
  3. In the Port text box, type 7822. …
  4. Confirm that the Connection type radio button is set to SSH.
  5. Click Open.

How do I run SSH on Windows 10?

How to Use SSH Commands in Windows 10

  1. Open Command Prompt (or PowerShell) Press Start and then type “Command Prompt”. …
  2. Run the SSH command to view its usage guide. Command Prompt will return a full list of options and syntax for you to use as you require.
  3. Connect to your server via your Windows Open SSH client.

What is the SSH config file?

Your SSH config file allows you to define specific settings for each SSH host that makes connecting to that host far easier. By defining many of these common, or uncommon, properties within the file, it eliminates the need to remember this parameter set each and every time a connection is needed.

How configure SSH config in Windows?

2 Answers

  1. Go to the . ssh directory /c/Users/PC_USER_NAME/. ssh/ , click right mouse button and choose «Git Bash Here»
  2. Create a file named «config» with the following command:

How do I edit a config file in SSH?

To modify the configuration files:

  1. Log on to the Linux machine as «root» with a SSH client such as PuTTy.
  2. Back up the configuration file you would like to edit in /var/tmp with the command «cp». For example: # cp /etc/iscan/intscan.ini /var/tmp.
  3. Edit the file with vim: Open the file in vim with the command «vim».

How do I access SSH config?

The ssh program on a host receives its configuration from either the command line or from configuration files ~/. ssh/config and /etc/ssh/ssh_config . Command-line options take precedence over configuration files. The user-specific configuration file ~/.

After OpenSSH installs, perform some additional configuration steps.

Ensure that the OpenSSH folder is included on the system path environment variable:

C:\Windows\System32\OpenSSH\ if installed as the Windows optional feature
C:\Program Files\OpenSSH\ if installed via the OpenSSH download
Set the two services to start automatically:

# PowerShell Admin
# Config services sshd and ssh-agent
# for start automatic when logon
Set-Service sshd -StartupType Automatic
Set-Service ssh-agent -StartupType Automatic

If you installed OpenSSH with the optional feature, then Windows creates a new firewall rule to allow inbound access of SSH over port 22. If you installed OpenSSH from the download, then create the firewall rule with this command:

# PowerShell Admin
# Add FireWall Rules for OpenSSH Server
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' `
-Enabled True -Direction Inbound -Protocol TCP `
-Action Allow -LocalPort 22

Start the sshd service to generate the SSH keys:

# PowerShell Admin
Start-Service sshd

The SSH keys and configuration file reside in C:\ProgramData\ssh, which is a hidden folder. The default shell used by SSH is the Windows command shell. This needs to change to PowerShell:

# PowerShell Admin
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell `
-Value "C:\Program Files\PowerShell\6\pwsh.exe" -PropertyType String -Force

Now, when you connect to the system over SSH, PowerShell Core will start and will be the default shell. You can also make the default shell Windows PowerShell if desired.

There’s a bug in OpenSSH on Windows. It doesn’t work with paths with a space, such as the path to the PowerShell Core executable! The workaround is to create a symbolic link that creates a path that OpenSSH can use:

# PowerShell Admin
New-Item -ItemType SymbolicLink -Path C:\pwsh -Target 'C:\Program Files\PowerShell\6'

In the sshd_config file, un-comment the following lines:

PubkeyAuthentication yes
PasswordAuthentication yes

Add this line before other subsystem lines:

Subsystem  powershell C:\pwsh\pwsh.exe -sshs -NoLogo -NoProfile

This tells OpenSSH to run PowerShell Core.

Comment out the line:

AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

After saving the changes to the sshd_config file, restart the services:

# PowerShell Admin
Restart-Service sshd
Start-Service ssh-agent

You need to restart the sshd service after any change to the config file.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Pick a username
Email Address
Password

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

5 Answers

%HOMEDRIVE%%HOMEPATH%\.ssh\id_rsa.pub is where the key is.

Peter Mortensen's user avatar

answered Jan 26, 2014 at 4:53

neuro_tarun's user avatar

neuro_tarunneuro_tarun

1,3721 gold badge10 silver badges8 bronze badges

3

  • On my computer it was in that folder but it was called github_rsa and had the paired github_rsa.pub with it.

    Aug 18, 2016 at 17:22

  • This is public key. SSH/GIT uses private one to authorize.

    Jan 30, 2017 at 17:38

  • where is it now in 2020

    Jan 6, 2020 at 22:21

On my work PC it is in %USERPROFILE%/.ssh/ and not %HOMEDRIVE%%HOMEPATH%/.ssh/.

On many computers those folders are the same location, but it depends on the configuration. So it seems %USERPROFILE% is the location used by GitHub for Windows, which is also the ~ home location for its Git Bash.

This is confusing since my Windows Git default installation uses %HOMEDRIVE%%HOMEPATH% as its ~ home location.

Peter Mortensen's user avatar

answered Jul 8, 2014 at 12:26

t3hmun's user avatar

t3hmunt3hmun

4315 silver badges8 bronze badges

0

The default location is: %HOMEDRIVE%%HOMEPATH%\.ssh\id_rsa.pub. That would expand to something like C:\Users\dennis\.ssh\id_rsa.pub.

If %HOMEDRIVE%%HOMEPATH%\.ssh\id_rsa.pub already exists, GitHub creates a key named github_rsa(.pub) in the same folder.

Peter Mortensen's user avatar

answered May 30, 2014 at 21:32

Dennis van der Schagt's user avatar

It’s in %HOMEDRIVE%%HOMEPATH%\.ssh.

Note that GitHub for Windows normally uses SSL; SSH keys won’t have been created unless you’ve used an SSH repository with it at some point.

Peter Mortensen's user avatar

answered Nov 26, 2013 at 19:34

rakslice's user avatar

rakslicerakslice

8,7824 gold badges53 silver badges57 bronze badges

On my Windows 10 Home the .ssh folder’s path is %HOMEDRIVE%%HOMEPATH%\AppData\Roaming\SPB_Data\.ssh

schlebe's user avatar

schlebe

3,4465 gold badges38 silver badges50 bronze badges

answered Oct 30, 2018 at 9:58

runovskyi's user avatar

1

  • Isn’t there a shorter form? Something like %USERPROFILE%\AppData\Roaming\SPB_Data\.ssh? Or even shorter, like %APPDATA%\SPB_Data\.ssh?

    Aug 30, 2020 at 18:16

  • Где лежат звуки windows 10
  • Где корзина в windows 10 pro
  • Где лежат точки восстановления windows 10
  • Где лежат заставки в windows 10
  • Где лежат темы рабочего стола в windows 10