23
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VPNを使わず支店間でファイルサーバの共有フォルダに接続

Last updated at Posted at 2014-07-14
  • autosshと組み合わせると安心。
ssh_server経由、192.168.10.100の共有フォルダにアクセスしたい
ssh -gNL 10445:192.168.10.100:445 ssh_server

スクリーンショット 2014-07-14 17.19.04.png

他のPCからもsshで接続したPCに smb://192.168.1.33:10445/profiles で閲覧できる。

これを常用している人いるんだろうか・・・

VPNについては以下サイトがわかりやすかった。

基本はPPTPが良いらしい。
しかしVPN接続とは接続先のLANにぶら下がる形。
そんな大げさなことをしたくないという場合にいいのではないでしょうか。

vpnを組む方法を調べたメモ

  • modprobe tun
  • /etc/ssh/sshd_config で PermitTunnel yes
  • ssh -w0:0 remote_serverでトンネル接続ができるらしい

OpenVPNサーバーが詳しそう
SSH でVPNを実現する - いますぐ実践! Linuxシステム管理 / Vol.248がわかりやすそうですが、情報が古い?

  • MacOSXではbrew install tuntapで/dev/tun[0-9], /dev/tap[0-9]ができる
  • TAP : データリンク層 (ルータ)
  • TUN : ネットワーク層 (ブリッジ)

OSXにtuntapをインストール手順

OSXにtuntapをインストール手順
brew install tuntap
sudo -s

cp -pR /usr/local/Cellar/tuntap/20111101/Library/Extensions/tap.kext /Library/Extensions/
cp -pR /usr/local/Cellar/tuntap/20111101/Library/Extensions/tun.kext /Library/Extensions/
chown -R root:wheel /Library/Extensions/tap.kext
chown -R root:wheel /Library/Extensions/tun.kext
touch /Library/Extensions/

cp -pR /usr/local/Cellar/tuntap/20111101/tap /Library/StartupItems/
chown -R root:wheel /Library/StartupItems/tap
cp -pR /usr/local/Cellar/tuntap/20111101/tun /Library/StartupItems/
chown -R root:wheel /Library/StartupItems/tun
アンインストール手順
brew remove tuntap
sudo rm -rf /Library/Extensions/{tap,tun}.kext
sudo rm -rf /Library/StartupItems/{tap,tun}/
23
23
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
23
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?