Windows OpenSSH Linux Sshfs
Windows OpenSSH Linux Sshfs
在
1. Windows 10 架設SFTP(SSH Server)
https://berglas.github.io/dest/articles/2020/7/note_SFTP_setting_1.html?fbclid=IwAR0lVvddEMcv3qld1QAkHvPSlrkQAkWE-
v2vsptBUwTEdHsUVyJOw7Tei1A
設定⾃動啟動
#
Set-Service -Name sshd -StartupType 'Automatic'
看
# firewall設定
Get-NetFirewallRule -Name *ssh*
Name : OpenSSH-Server-In-TCP
DisplayName : OpenSSH SSH Server (sshd)
Description : Inbound rule for OpenSSH SSH Server (sshd)
DisplayGroup : OpenSSH Server
Group : OpenSSH Server
Enabled : True
Profile : Any
Platform : {}
Direction : Inbound
Action : Allow
EdgeTraversalPolicy : Block
LooseSourceMapping : False
LocalOnlyMapping : False
Owner :
PrimaryStatus : OK
Status : 已從存放區成功剖析規則。 (65536)
EnforcementStatus : NotApplicable
PolicyStoreSource : PersistentStore
PolicyStoreSourceType : Local
RemoteDynamicKeywordAddresses :
如果沒有開
# 22 port ,⽤下⾯指令開啟
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort
su - stevenlin
[stevenlin@centos7 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 8.7M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mapper/centos-root 50G 2.0G 49G 4% /
/dev/sda1 1014M 138M 877M 14% /boot
/dev/mapper/centos-home 46G 33M 46G 1% /home
tmpfs 396M 0 396M 0% /run/user/0
user@192.168.43.240:D:\software 316G 78G 238G 25% /home/stevenlin/win_user_soft
# 解除連線
fusermount -u -z /home/stevenlin/win_user_soft
核對windows內的檔案
4.測試遠端Server 跨OS。複製檔案。
[stevenlin@centos7 ~]$ cp ~/win_user_soft/setup-x86_64.exe ~/linux_eric_doc/
[stevenlin@centos7 ~]$ ls linux_eric_doc/
setup-x86_64.exe
[stevenlin@centos7 ~]$
[stevenlin@centos7 ~]$ cp ~/win_user_soft/setup-x86_64.exe ~/linux_eric_doc/
[stevenlin@centos7 ~]$ ls linux_eric_doc/
setup-x86_64.exe
[stevenlin@centos7 你好 我來⾃
~]$ echo ' , Linux' > ~/linux_eric_doc/linux_file.txt
[stevenlin@centos7 ~]$ cp ~/linux_eric_doc/linux_file.txt ~/win_user_soft/
[stevenlin@centos7 ~]$ ll ~/win_user_soft
total 8795512
-rw----rwx. 1 root root 0 Sep 6 23:44 aa
-rw----rwx. 1 root root 0 Sep 6 23:44 bb
-rw----rwx. 1 root root 4712300544 Mar 23 01:38 CentOS-7-x86_64-DVD-2009.iso
-rw----rwx. 1 root root 22 Sep 7 2022 linux_file.txt
drwx---rwx. 1 root root 4096 Mar 22 20:37 oracle_soft
-rwx---rwx. 1 root root 1225235 Jun 6 2019 setup-x86_64.exe
-rw----rwx. 1 root root 4293066752 Mar 12 2020 Windows.iso