User Tools

Site Tools


vps:vps4th_06

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

vps:vps4th_06 [2016/12/31 17:03]
hoge@hoge [pkg]
vps:vps4th_06 [2019/06/16 15:16]
Line 1: Line 1:
-====== prisoner desktop設定 ====== 
-prisonerのdesktopをVDIにする。 
- 
-===== 事前設定 ===== 
-jailerから各設定ファイルを直接編集する。各設定ファイルのプレフィックスは/​usr/​jail/​desktopとなる。 
- 
-  * etc/​syslog.confでconsole出力をコメント化する。<​code>​ 
-# *.err;​kern.warning;​auth.notice;​mail.crit ​             /​dev/​console 
-</​code>​ 
-  * etc/​crontabで不要なcronをコメント化する。<​code>​ 
- # 1,31  0-5     ​* ​      ​* ​      ​* ​      ​root ​   adjkerntz -a 
-</​code>​ 
-  * etc/​pw.confを新規作成する。prisoner内のuid,​ gidとjailerのuid,​ gidが同じになるとセキュリティ上の問題が発生するため、uid,​ gidの範囲を設定する。<​code>​ 
-minuid 2201 
-maxuid 2300 
-mingid 2201 
-maxgid 2300 
-</​code>​ 
-  * etc/​fstabをtouchで作成する。 
-  * etc/​resolv.confを作成する。<​code>​ 
-domain "​ドメイン名"​ 
-nameserver "​さくらのVPS指定 1" 
-nameserver "​さくらのVPS指定 2" 
-</​code>​ 
-  * etc/​hostsにweb自身と内側のホスト(jailer,​ prisoner)を登録する。<​code>​ 
-127.0.0.1 ​            ​localhost localhost.example.com 
-192.168.100.254 ​      gw gw.example.com 
-192.168.100.1 ​        web web.example.com 
-192.168.100.2 ​        ​desktop desktop.example.com 
-192.168.100.2 ​        ​desktop.example.com. 
-192.168.100.253 ​      vps vps.example.com 
-</​code>​ 
-  * etc/​rc.confを新規作成する。<​code>​ 
-hostname="​desktop.example.com"​ 
-ifconfig_epair3b="​inet 192.168.100.2 netmask 255.255.255.0"​ 
-defaultrouter="​192.168.100.254"​ 
-firewall_enable="​YES"​ 
-firewall_type="​open"​ 
-ssd_enable="​YES"​ 
-</​code>​ 
-    * ifcofig_epair3b\\ jailerで作成したepair3の一端。jailerからprisonerであるdesktopに割り当てる。 
- 
-===== OS設定 ===== 
-prisoner desktopを起動後、以下の設定を行う。 
-  * prisoner:​desktopへ移動<​code>​ 
-# jexec desktop /bin/sh 
-</​code>​ 
-  * newaliasesの実行<​code>​ 
-# newaliases 
- /​etc/​mail/​aliases:​ 27 aliases, longest 10byte, 275 bytes total 
-</​code>​ 
-  * bsdconfigでそれぞれ設定。 
-    * Root Password 
-    * User Management 
-    * Time Zone 
- 
-===== ssh設定 ===== 
-==== sshd ==== 
-  * /​etc/​ssh/​sshd_configにて以下の設定を行う。<​code>​ 
-ChallengeResponseAuthentication no 
-</​code>​ 
-  * 設定後、sshdを再起動する。<​code>​ 
-# service sshd restart 
-</​code>​ 
- 
-==== ユーザ設定 ==== 
-  * ユーザ毎に$home/​.sshを作成する。 
-  * $HOME/​.ssh/​authorized_keysを作成する。<​code>​ 
-#cat "​ユーザの公開鍵"​ >> authorized_keys 
-</​code>​ 
- 
-===== ソフトウェア導入 ===== 
-==== pkg ==== 
-pkgにて、以下を導入。 
-  * xorg 
-  * gnucash 
-  * ja-ibus-mozc 
- 
- 
- 
-==== vncserver ==== 
-=== 設定 === 
-  * $HOME/​.vnc/​xstartupを作成する。<​code>​ 
-#!/bin/sh 
- 
-startxfce4 
-vncserver -kill ${DISPLAY} 
-</​code>​ 
-  * chmod<​code>​ 
-# chmod 744 xstartup 
-</​code>​ 
-  * 起動例<​code>​ 
-$ vncserver -geometry 1280x800 
-</​code>​ 
-  *スクリプト例 startvnc<​code>​ 
-#!/bin/sh 
- 
-DISP=${1} 
- 
-if [ $# -ne 0 ] 
-then 
-          case ${DISP} in 
-                  "​0"​) GEO="​800x600";;​ 
-                  "​1"​) GEO="​1024x768";;​ 
-                  "​2"​) GEO="​1280x800";;​ 
-          esac 
- 
-          vncserver -geometry ${GEO} -depth 15 
-else 
-          echo "No ARG" 
-fi 
-</​code>​ 
- 
-=== 使用方法 === 
-  - リモート環境より、以下の様に接続する。<​code>​ 
-ssh -i <​秘密鍵>​ <​ユーザ名@接続先>​ -p <​ポート番号>​ -<​ポートフォワード例 L6666:​localhost:​5901>​ 
-</​code>​ 
-  - ログイン後、desktop側でvncserverを起動する。 
-  - リモート側でvncviewerなどで接続する。 
- 
-==== gnucash ​ ==== 
-=== 設定 === 
- 
-  * 外部からのssh接続でgnucashを利用するため、$HOME/​Tools/​gnucash_x11.shを作成する。<​code>​ 
-#!/bin/sh 
- 
-export LANG=ja_JP.UTF-8 
-export LC_ALL=ja_JP.UTF-8 
-export GTK_IM_MODULE=ibus 
-export QT_IM_MODULE=xim 
-export XMODIFIERS=@im=ibus 
- 
-/​usr/​local/​bin/​mozc start 
-/​usr/​local/​bin/​ibus-daemon -r --daemonize --xim  
-/​usr/​local/​bin/​gnucash 
-</​code>​ 
- 
-=== 使用方法 === 
-  - リモートのX11環境より以下の様に実行する。<​code>​ 
-$ ssh -f -Y -i <​秘密鍵>​ -p <​ポート番号>​ <​ユーザ名>​@<​接続先>​ <​path>​gnucash_x11.sh 
-</​code>​ 
-  - リモート側に gnucash が出力される。 
  
vps/vps4th_06.txt · Last modified: 2019/06/16 15:16 (external edit)