Win sshfs windows 10

Использование встроенного SSH клиента в Windows 10

В Windows 10 и Windows Server 2019 появился встроенный SSH клиент, который вы можете использовать для подключения к *Nix серверам, ESXi хостам и другим устройствам по защищенному протоколу, вместо Putty, MTPuTTY или других сторонних SSH клиентов. Встроенный SSH клиент Windows основан на порте OpenSSH и предустановлен в ОС, начиная с Windows 10 1809.

Установка клиента OpenSSH в Windows 10

Клиент OpenSSH входит в состав Features on Demand Windows 10 (как и RSAT). Клиент SSH установлен по умолчанию в Windows Server 2019 и Windows 10 1809 и более новых билдах.

Проверьте, что SSH клиент установлен:

Get-WindowsCapability -Online | ? Name -like ‘OpenSSH.Client*’

В нашем примере клиент OpenSSH установлен (статус: State: Installed).

Если SSH клиент отсутствует (State: Not Present), его можно установить:

  • С помощью команды PowerShell: Add-WindowsCapability -Online -Name OpenSSH.Client*
  • С помощью DISM: dism /Online /Add-Capability /CapabilityName:OpenSSH.Client

0.0.1.0

  • Через Параметры -> Приложения -> Дополнительные возможности -> Добавить компонент. Найдите в списке Клиент OpenSSH и нажмите кнопку Установить.
  • ]Бинарные файлы OpenSSH находятся в каталоге c:\windows\system32\OpenSSH\.

    • ssh.exe – это исполняемый файл клиента SSH;
    • scp.exe – утилита для копирования файлов в SSH сессии;
    • ssh-keygen.exe – утилита для генерации ключей аутентификации;
    • ssh-agent.exe – используется для управления ключами;
    • ssh-add.exe – добавление ключа в базу ssh-агента.

    Как использовать SSH клиенте в Windows 10?

    Чтобы запустить SSH клиент, запустите командную строку PowerShell или cmd.exe . Выведите доступные параметры и синтаксис утилиты ssh.exe, набрав команду:

    ssh
    usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
    [-D [bind_address:]port] [-E log_file] [-e escape_char]
    [-F configfile] [-I pkcs11] [-i identity_file]
    [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
    [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
    [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
    destination [command]

    Для подключения к удаленному серверу по SSH используется команда:

    Если SSH сервер запущен на нестандартном порту, отличном от TCP/22, можно указать номер порта:

    ssh username@host -p port

    Например, чтобы подключиться к Linux хосту с IP адресом 192.168.1.202 под root, выполните:

    При первом подключении появится запрос на добавление ключа хоста в доверенные, наберите yes -> Enter (при этом отпечаток ключа хоста добавляется в файл C:\Users\username\.ssh\known_hosts).

    Затем появится запрос пароля указанной учетной записи, укажите пароль root, после чего должна открытся консоль удаленного Linux сервера (в моем примере на удаленном сервере установлен CentOS 8).

    Если вы используете SSH аутентификацию по RSA ключам (см. пример с настройкой SSH аутентификации по ключам в Windows), вы можете указать путь к файлу с закрытым ключом в клиенте SSH так:

    ssh root@192.168.1.92 -i «C:\Users\username\.ssh\id_rsa»

    Также вы можете добавить ваш закрытый ключ в SSH-Agent. Сначала нужно включить службу ssh-agent и настроить ее автозапуск:

    set-service ssh-agent StartupType ‘Automatic’
    Start-Service ssh-agent

    Добавим ваш закрытый ключ в базу ssh-agent:

    Теперь вы можете подключиться к серверу по SSH без указания пути к RSA ключу, он будет использоваться автоматически. Пароль для подключения не запрашивается (если только вы не защитили ваш RSA ключ отдельным паролем):

    Еще несколько полезных аргументов SSH:

    • -C – сжимать трафик между клиентом и сервером (полезно на медленных и нестабильных подключениях);
    • -v – вывод подробной информации обо всех действия клиента ssh;
    • -R / -L – можно использовать для проброса портов через SSH туннель.

    SCP: копирование файлов из/в Windows через SSH

    С помощью утилиты scp.exe, которая входит в состав пакета клиента SSH, вы можете скопировать файл с вашего компьютера на SSH сервер:

    scp.exe «E:\ISO\CentOS-8.1.1911-x86_64.iso» root@192.168.1.202:/home

    Можно рекурсивно скопировать все содержимое каталога:

    scp -r E:\ISO\ root@192.168.1.202:/home

    И наоборот, вы можете скопировать файл с удаленного сервера на ваш компьютер:

    scp.exe root@192.168.1.202:/home/CentOS-8.1.1911-x86_64.iso e:\tmp

    Итак, теперь вы можете прямо из Windows 10 подключаться к SSH серверам, копировать файлы с помощью scp без установки сторонних приложений и утилит.

    Win sshfs windows 10

    SSHFS-Win · SSHFS for Windows

    Download

    GUI Frontends

    SSHFS-Win is a minimal port of SSHFS to Windows. Under the hood it uses Cygwin for the POSIX environment and WinFsp for the FUSE functionality.

    • Install the latest version of WinFsp.
    • Install the latest version of SSHFS-Win. Choose the x64 or x86 installer according to your computer’s architecture.

    Once you have installed WinFsp and SSHFS-Win you can map a network drive to a directory on an SSHFS host using Windows Explorer or the net use command.

    In Windows Explorer select This PC > Map Network Drive and enter the desired drive letter and SSHFS path using the following UNC syntax:

    The first time you map a particular SSHFS path you will be prompted for the SSHFS username and password. You may choose to save these credentials with the Windows Credential Manager in which case you will not be prompted again.

    In order to unmap the drive, right-click on the drive icon in Windows Explorer and select Disconnect.

    You can map a network drive from the command line using the net use command:

    You can list your net use drives:

    Finally you can unmap the drive as follows:

    The complete UNC syntax is as follows:

    • REMUSER is the remote user (i.e. the user on the SSHFS host whose credentials are being used for access).
    • HOST is the SSHFS host.
    • PORT is the remote port on the SSHFS host (optional; default is 22).
    • PATH is the remote path. This is interpreted as follows:
      • The sshfs prefix maps to HOST:

      REMUSER/PATH on the SSHFS host (i.e. relative to REMUSER ‘s home directory).

    • The sshfs.r prefix maps to HOST:/PATH on the SSHFS host (i.e. relative to the HOST ‘s root directory).
    • The sshfs.k prefix maps to HOST:

      REMUSER/PATH and uses the ssh key in %USERPROFILE%/.ssh/id_rsa (where %USERPROFILE% is the home directory of the local Windows user).

    • The sshfs.kr prefix maps to HOST:/PATH and uses the ssh key in %USERPROFILE%/.ssh/id_rsa .
  • LOCUSER is the local Windows user (optional; USERNAME or DOMAIN+USERNAME format).
    • Please note that this functionality is rarely necessary with latest versions of WinFsp.
  • There are currently 2 GUI front ends for SSHFS-Win: SiriKali and SSHFS-Win-Manager.

    SiriKali is a GUI front end for SSHFS-Win (and other file systems). Instructions on setting up SiriKali for SSHFS-Win can be found at this link. Please report problems with SiriKali in its issues page.

    • Password authentication.
    • Public key authentication.
    • Key Agents and KeePass 2.

    SSHFS-Win-Manager is a new GUI front end specifically for SSHFS-Win with a user-friendly and intuitive interface. SSHFS-Win-Manager integrates well with Windows and can be closed to the system tray. Please report problems with SSHFS-Win-Manager in its issues page.

    • Password authentication.
    • Public key authentication.

    It is possible to use the sshfs-win.exe and sshfs.exe programs directly for advanced usage scenarios. Both programs can be found in the bin subdirectory of the SSHFS-Win installation (usually \Program Files\SSHFS-Win\bin ).

    The sshfs-win.exe program is useful to launch sshfs.exe from a cmd.exe prompt ( sshfs-win cmd ) or to launch sshfs.exe under the control of the WinFsp Launcher ( sshfs-win svc ). The sshfs-win.exe program SHOULD NOT be used from Cygwin. The sshfs-win.exe program has the following usage:

    The sshfs.exe program can be used with an existing Cygwin installation, but it requires prior installation of FUSE for Cygwin on that Cygwin installation. FUSE for Cygwin is included with WinFsp and can be installed on a Cygwin installation by executing the command:

    This is a simple project:

    • sshfs is a submodule pointing to the original SSHFS project.
    • sshfs-win.c is a simple wrapper around the sshfs program that is used to implement the «Map Network Drive» functionality.
    • sshfs-win.wxs is a the Wix file that describes the SSHFS-Win installer.
    • patches is a directory with a couple of simple patches over SSHFS.
    • Makefile drives the overall process of building SSHFS-Win and packaging it into an MSI.

    In order to build SSHFS-Win you will need Cygwin and the following Cygwin packages:

    You will also need:

    FUSE for Cygwin. It is included with WinFsp and can be installed on a Cygwin installation by executing the command:

    Wix toolset. This is a native Windows package that is used to build the SSHFS-Win MSI installer.

    • Open a Cygwin prompt.
    • Change directory to the sshfs-win repository.
    • Issue make .
    • The sshfs-win repository includes the upstream SSHFS project as a submodule; if you have not already done so, you must initialize it with git submodule update —init sshfs .

    SSHFS-Win uses the same license as SSHFS, which is GPLv2+. It interfaces with WinFsp which is GPLv3 with a FLOSS exception.

    It also packages the following components:

    • Cygwin: LGPLv3
    • GLib2: LGPLv2
    • SSH: «all components are under a BSD licence, or a licence more free than that»

    Win sshfs windows 10

    SSHFS-Win · SSHFS for Windows

    Download

    GUI Frontends

    SSHFS-Win is a minimal port of SSHFS to Windows. Under the hood it uses Cygwin for the POSIX environment and WinFsp for the FUSE functionality.

    • Install the latest version of WinFsp.
    • Install the latest version of SSHFS-Win. Choose the x64 or x86 installer according to your computer’s architecture.

    Once you have installed WinFsp and SSHFS-Win you can map a network drive to a directory on an SSHFS host using Windows Explorer or the net use command.

    In Windows Explorer select This PC > Map Network Drive and enter the desired drive letter and SSHFS path using the following UNC syntax:

    The first time you map a particular SSHFS path you will be prompted for the SSHFS username and password. You may choose to save these credentials with the Windows Credential Manager in which case you will not be prompted again.

    In order to unmap the drive, right-click on the drive icon in Windows Explorer and select Disconnect.

    You can map a network drive from the command line using the net use command:

    You can list your net use drives:

    Finally you can unmap the drive as follows:

    The complete UNC syntax is as follows:

    • REMUSER is the remote user (i.e. the user on the SSHFS host whose credentials are being used for access).
    • HOST is the SSHFS host.
    • PORT is the remote port on the SSHFS host (optional; default is 22).
    • PATH is the remote path. This is interpreted as follows:
      • The sshfs prefix maps to HOST:

      REMUSER/PATH on the SSHFS host (i.e. relative to REMUSER ‘s home directory).

    • The sshfs.r prefix maps to HOST:/PATH on the SSHFS host (i.e. relative to the HOST ‘s root directory).
    • The sshfs.k prefix maps to HOST:

      REMUSER/PATH and uses the ssh key in %USERPROFILE%/.ssh/id_rsa (where %USERPROFILE% is the home directory of the local Windows user).

    • The sshfs.kr prefix maps to HOST:/PATH and uses the ssh key in %USERPROFILE%/.ssh/id_rsa .
  • LOCUSER is the local Windows user (optional; USERNAME or DOMAIN+USERNAME format).
    • Please note that this functionality is rarely necessary with latest versions of WinFsp.
  • There are currently 2 GUI front ends for SSHFS-Win: SiriKali and SSHFS-Win-Manager.

    SiriKali is a GUI front end for SSHFS-Win (and other file systems). Instructions on setting up SiriKali for SSHFS-Win can be found at this link. Please report problems with SiriKali in its issues page.

    • Password authentication.
    • Public key authentication.
    • Key Agents and KeePass 2.

    SSHFS-Win-Manager is a new GUI front end specifically for SSHFS-Win with a user-friendly and intuitive interface. SSHFS-Win-Manager integrates well with Windows and can be closed to the system tray. Please report problems with SSHFS-Win-Manager in its issues page.

    • Password authentication.
    • Public key authentication.

    It is possible to use the sshfs-win.exe and sshfs.exe programs directly for advanced usage scenarios. Both programs can be found in the bin subdirectory of the SSHFS-Win installation (usually \Program Files\SSHFS-Win\bin ).

    The sshfs-win.exe program is useful to launch sshfs.exe from a cmd.exe prompt ( sshfs-win cmd ) or to launch sshfs.exe under the control of the WinFsp Launcher ( sshfs-win svc ). The sshfs-win.exe program SHOULD NOT be used from Cygwin. The sshfs-win.exe program has the following usage:

    The sshfs.exe program can be used with an existing Cygwin installation, but it requires prior installation of FUSE for Cygwin on that Cygwin installation. FUSE for Cygwin is included with WinFsp and can be installed on a Cygwin installation by executing the command:

    This is a simple project:

    • sshfs is a submodule pointing to the original SSHFS project.
    • sshfs-win.c is a simple wrapper around the sshfs program that is used to implement the «Map Network Drive» functionality.
    • sshfs-win.wxs is a the Wix file that describes the SSHFS-Win installer.
    • patches is a directory with a couple of simple patches over SSHFS.
    • Makefile drives the overall process of building SSHFS-Win and packaging it into an MSI.

    In order to build SSHFS-Win you will need Cygwin and the following Cygwin packages:

    You will also need:

    FUSE for Cygwin. It is included with WinFsp and can be installed on a Cygwin installation by executing the command:

    Wix toolset. This is a native Windows package that is used to build the SSHFS-Win MSI installer.

    • Open a Cygwin prompt.
    • Change directory to the sshfs-win repository.
    • Issue make .
    • The sshfs-win repository includes the upstream SSHFS project as a submodule; if you have not already done so, you must initialize it with git submodule update —init sshfs .

    SSHFS-Win uses the same license as SSHFS, which is GPLv2+. It interfaces with WinFsp which is GPLv3 with a FLOSS exception.

    It also packages the following components:

    • Cygwin: LGPLv3
    • GLib2: LGPLv2
    • SSH: «all components are under a BSD licence, or a licence more free than that»
    Читайте также:  What is memory management in linux
    Оцените статью