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)

0
Last updated at Posted at 2023-09-08

:flag_jp: Japanese notation

OpenWrt_icon.png

はじめに

記事について

SAMBA4 (WSDD2)とディスクのOpenWrt初期設定・運用ガイドです
インストールから各種設定、チューニングなどをまとめています

初心者対応構成

デバイスアクセス

PowerShellの開始

  • パワーシェル起動:キー入力:Win+x > a > はい
  • コンソールログイン (パワーシェル)
    ※192.168.1.1以外の場合、以下の形式で入力後にワンライナーを入力下さい
$ip="192.168.*.*"
  • コンソールログイン (192.168.1.1用)
    万能型ワンライナー
if(!$ip){$ip="192.168.1.1"}; ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=NUL -o GlobalKnownHostsFile=NUL -o HostKeyAlgorithms=+ssh-rsa -tt root@$ip

SAMBA4 (WSDD2)

設定

SAMBA4
ネットワーク共有(NAS)

WSDD2
Windowsネットワーク可視化

インストール

#!/bin/sh
I18N="ja"
PKGS="luci-app-samba4 luci-i18n-samba4-${I18N} wsdd2"
UPDATE="${UPDATE:-$(command -v opkg && opkg update >&2; command -v apk && apk update >&2; echo 1)}"
command -v opkg && opkg install $PKGS
command -v apk && apk add $PKGS

認証あり

# UCI設定
NAS="openwrt"
MNT="/mnt/sda1"
uci set samba4.@samba[0]=samba
uci set samba4.@samba[0].workgroup='WORKGROUP'
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.guest_ok='no'
uci commit samba4
/etc/init.d/samba4 restart

匿名アクセス

OpenWrt設定

# UCI設定
NAS="share"
MNT="/mnt/sda1/shared"
mkdir -p ${MNT}
chmod -R 0777 ${MNT}

uci set samba4.@samba[0]=samba
uci set samba4.@samba[0].workgroup='WORKGROUP'
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.guest_ok='yes'
uci set samba4.sambashare.force_root='1'
uci set samba4.sambashare.create_mask='0666'
uci set samba4.sambashare.dir_mask='0777'
uci commit samba4
/etc/init.d/samba4 restart

Windows設定

  • パワーシェル起動:キー入力:Win+x > a > はい
powershell
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name "AllowInsecureGuestAuth" -Value 1 -Type DWord
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" -Name "AllowInsecureGuestAuth" -Value 1 -Type DWord -Force
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation")) {
    New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" -Force
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" -Name "AllowInsecureGuestAuth" -Value 1 -Type DWord
}
Write-Host "設定完了。Windowsを再起動してください。" -ForegroundColor Green
$restart = Read-Host "今すぐ再起動しますか? (Y/N)"
if ($restart -eq "Y" -or $restart -eq "y") {
    Restart-Computer -Force
}

Windows で SMBv1、SMBv2、および SMBv3 を検出、有効化、および無効化する方法

powershell
Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

フラッシュ&インストールシステム

aios.png

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?