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 プライバシー

Last updated at Posted at 2023-07-05

はじめに

初心者対応構成

  • スクリプトでの自動設定
  • 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


プライバシー

マックアドレス ランダマイザー

※OCNバーチャルコネクトではWAN側マックアドレスを変更すると疎通不能になる

ランダムマックアドレスを使用したいネットワークデバイス番号を見つける

uci show network

例 :
network.@device[0].name='br-lan'
network.@device[1].name='eth0'
network.@device[2].name='lan1'
network.@device[3].name='lan2'
network.@device[4].name='lan3'

不要なネットワークデバイス番号を#(コメントアウト)
例:LANのアドレスをランダム化

cat << "EOF" > /etc/init.d/randomizer
#!/bin/sh /etc/rc.common
# Example script
# Copyright (C) 2007 OpenWrt.org

START=17

start() {
NEWMAC=$(printf "%02x" $(( $(hexdump -n1 -e'/1 "0x%02x"' /dev/urandom) & ~1 | 2)) && hexdump -n5 -e'/1 ":%02x"' /dev/urandom)
logger "[randomizer] Applying new random MAC address to LAN & WAN(${NEWMAC})..."
# uci set network.@device[0].macaddr=${NEWMAC}
uci set network.@device[1].macaddr=${NEWMAC}
uci set network.@device[2].macaddr=${NEWMAC}
uci set network.@device[3].macaddr=${NEWMAC}
# uci set network.@device[4].macaddr=${NEWMAC}
# uci set wireless.default_radio0.macaddr=${NEWMAC}
# uci set wireless.default_radio1.macaddr=${NEWMAC}
uci commit network
# uci commit wireless
}
EOF
chmod +x /etc/init.d/randomizer
/etc/init.d/randomizer enable
/etc/init.d/randomizer start

位置情報サービス停止(LBS)

cp /etc/config/wireless /etc/config/wireless.bak
sed -i -e 's/\s*$//' /etc/config/wireless
sed -i -e "/option ssid/s/'$//" /etc/config/wireless
sed -i -e "/option ssid/s/$/_optout_nomap'/g" /etc/config/wireless
/etc/init.d/network restart

クライアントのSSIDを以下に変更
SSID_optout_nomap

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?