Hello.
I'm trying to mount a disk on FreeBSD shared in Windows by installing SFTP/OpenSSH/SSHFS. Below you can see what I did right now :
on Windows 11 :
followed this tutorial : https://winscp.net/eng/docs/guide_windows_openssh_server#fn2
1) Downloaded the latest OpenSSH for Windows from here :
2) As the Administrator, extracted the package to C:\Program Files\OpenSSH
3) As the Administrator, installed sshd and ssh-agent services with this command :
4) As the Administrator, ran the following PowerShell command :
5)
6) Before the first connection,found out the fingerprint of the server’s host key by using ssh-keygen.exe for each file. In Windows command-prompt, used :
7)
8) According with this tutorial : https://github.com/winfsp/sshfs-win
a) Installed the latest version of WinFsp.
b) Installed the latest version of SSHFS-Win.
c) Installed the latest version of SSHFS-Win Manager.
d) With SSHFS-Win Manager mounted the SSHFS drive G: mapped as drive : drive_g (J)
On FreeBSD :
This is the error I get :
# sshfs -o allow_other -o sshfs_debug marietto@192.168.1.6:/drive_g /mnt/sshfs
SSHFS version 3.7.2
ssh: connect to host 192.168.1.6 port 22: operation timed out
remote host has disconnected
But in Windows it works great. Please give a look at the screenshots that I have attached. If it works on Windows,it should work also in FreeBSD. So,I suppose the error is on the FreeBSD configuration.
I'm trying to mount a disk on FreeBSD shared in Windows by installing SFTP/OpenSSH/SSHFS. Below you can see what I did right now :
on Windows 11 :
followed this tutorial : https://winscp.net/eng/docs/guide_windows_openssh_server#fn2
1) Downloaded the latest OpenSSH for Windows from here :
2) As the Administrator, extracted the package to C:\Program Files\OpenSSH
3) As the Administrator, installed sshd and ssh-agent services with this command :
Code:
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
4) As the Administrator, ran the following PowerShell command :
Code:
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH SSH Server' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -Program "C:\Program Files\OpenSSH\ssh.exe"
Name : sshd
DisplayName : OpenSSH SSH Server
Description :
DisplayGroup :
Group :
Enabled : True
Profile : Any
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : The rule was parsed successfully from the store. (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses : {}
5)
Code:
C:\ProgramData\ssh\sshd_config :
PermitRootLogin yes
#AllowAgentForwarding yes
AllowTcpForwarding remote
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
PermitTunnel yes
#ChrootDirectory none
#VersionAddendum none
#PasswordAuthentication yes
#PermitEmptyPasswords no
6) Before the first connection,found out the fingerprint of the server’s host key by using ssh-keygen.exe for each file. In Windows command-prompt, used :
Code:
λ for %f in (%ProgramData%\ssh\ssh_host_*_key) do c:\"program files"\OpenSSH\ssh-keygen.exe -l -f "%f"
c:\"program files"\OpenSSH\ssh-keygen.exe -l -f "C:\ProgramData\ssh\ssh_host_dsa_key"
1024 SHA256: authority\system@marietto-windows11 (DSA)
c:\"program files"\OpenSSH\ssh-keygen.exe -l -f "C:\ProgramData\ssh\ssh_host_ecdsa_key"
256 SHA256: authority\system@marietto-windows11 (ECDSA)
c:\"program files"\OpenSSH\ssh-keygen.exe -l -f "C:\ProgramData\ssh\ssh_host_ed25519_key"
256 SHA256: authority\system@marietto-windows11 (ED25519)
c:\"program files"\OpenSSH\ssh-keygen.exe -l -f "C:\ProgramData\ssh\ssh_host_rsa_key"
3072 SHA256: authority\system@marietto-windows11 (RSA)
7)
Code:
C:\ProgramData\ssh
λ ipconfig
Windows IP Configuration
Ethernet adapter Ethernet 4:
Connection-specific DNS Suffix . : homenet.telecomitalia.it
IPv4 Address. . . . . . . . . . . : 192.168.1.6
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
λ ping 192.168.1.6
Pinging 192.168.1.6 with 32 bytes of data:
Reply from 192.168.1.6: bytes=32 time<1ms TTL=128
Reply from 192.168.1.6: bytes=32 time<1ms TTL=128
SERVICE_NAME: ssh-agent
DISPLAY_NAME: OpenSSH Authentication Agent
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 8788
FLAGS :
SERVICE_NAME: sshd
DISPLAY_NAME: OpenSSH SSH Server
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 11176
FLAGS :
8) According with this tutorial : https://github.com/winfsp/sshfs-win
a) Installed the latest version of WinFsp.
b) Installed the latest version of SSHFS-Win.
c) Installed the latest version of SSHFS-Win Manager.
d) With SSHFS-Win Manager mounted the SSHFS drive G: mapped as drive : drive_g (J)
On FreeBSD :
Code:
/etc/rc.conf :
hostname="marietto"
ifconfig_em0="DHCP"
local_unbound_enable="YES"
sshd_enable="YES"
gateway_enable="YES"
kld_list="fusefs"
cloned_interfaces="bridge0 tap0 eth0 lo1"
ifconfig_bridge0="addm em0 addm tap0"
/usr/home/marietto/Desktop # ping 192.168.1.6
PING 192.168.1.6 (192.168.1.6): 56 data bytes
64 bytes from 192.168.1.6: icmp_seq=0 ttl=128 time=0.222 ms
64 bytes from 192.168.1.6: icmp_seq=1 ttl=128 time=1.230 ms
64 bytes from 192.168.1.6: icmp_seq=2 ttl=128 time=0.224 ms
This is the error I get :
# sshfs -o allow_other -o sshfs_debug marietto@192.168.1.6:/drive_g /mnt/sshfs
SSHFS version 3.7.2
ssh: connect to host 192.168.1.6 port 22: operation timed out
remote host has disconnected
But in Windows it works great. Please give a look at the screenshots that I have attached. If it works on Windows,it should work also in FreeBSD. So,I suppose the error is on the FreeBSD configuration.