0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenWrt SAMBA4 (WSDD2)

Last updated at Posted at 2023-09-08

こちらに統合しました

はじめに

初心者対応構成

  • スクリプトでの自動設定
  • UCIとLuCi及びWinSCPにて比較しながら作業がおススメ

PowerShellSSHアクセス

ssh root@192.168.1.1
ssh root@192.168.1.1のショートカット作成(デスクトップ)
powershell
$DESKTOP = ([Environment]::GetFolderPath("Desktop") + "\192.168.1.1.lnk")
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$DESKTOP")
$Shortcut.TargetPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
$Shortcut.Arguments = '-windowstyle hidden -ExecutionPolicy RemoteSigned "Start-Process ssh root@192.168.1.1"'
$Shortcut.IconLocation = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe,0"
$Shortcut.WorkingDirectory = "."
$Shortcut.Save()

  • 強制的に貼り付け
  • yes

SSHログイン出来ない場合:exclamation:

known_hostsクリア

  • C:\Users\yourusername\.ssh\known_hosts ※Windows隠しファイル
powershell
Clear-Content .ssh\known_hosts -Force


OpenSSHのインストール
※Windows 10 Fall Creators Update(1709)以降標準搭載

  • 機能の確認
powershell
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

  • 機能のインストール
powershell
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0


設定

SAMBA4

ネットワーク共有(NAS)

WSDD2

Windowsネットワーク可視化

opkg update
opkg install luci-app-samba4
opkg install luci-i18n-samba4-ja
opkg install wsdd2

#例: アクセスフリー
NAS="openwrt"
MNT="/mnt/sda"
uci set samba4.@samba[0]=samba
uci set samba4.@samba[0].workgroup='WORKGROUP'
uci set samba4.@samba[0].charset='UTF-8'
uci set samba4.@samba[0].description='Samba on OpenWRT'
uci set samba4.@samba[0].enable_extra_tuning='1'
uci set samba4.@samba[0].interface='lan'
uci set samba4.sambashare=sambashare
uci set samba4.sambashare.name=${NAS}
uci set samba4.sambashare.path=${MNT}
uci set samba4.sambashare.read_only='no'
uci set samba4.sambashare.force_root='1'
uci set samba4.sambashare.guest_ok='yes'
uci set samba4.sambashare.inherit_owner='yes'
uci set samba4.sambashare.create_mask='0777'
uci set samba4.sambashare.dir_mask='0777'
uci commit samba4

/etc/init.d/samba4 enable
/etc/init.d/samba4 restart
/etc/init.d/wsdd2 restart

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?