目次
FreeBSDの基礎知識
概要
歴史
なぜFreeBSD?
インストール
VNCコンソール起動の不具合
MacOSX Lion以上では、さくらのVNCコンソールが起動しない。 http://decomo.info/wiki/blog/2013/2013-05-18
JAVA7ではなく、JAVA6にダウングレードすると正常に起動する。 (さらに、今回はFireFoxを使って起動した。)
Java for OS X 2013-002 および最新バージョンの Oracle Java 7 をインストールした後に、Java 7 を無効にして、Apple 提供の Java SE 6 Web プラグインと Web Start 機能を再び有効にしたい場合は、以下の手順を実行します。
注意:必ず管理者としてログインする必要があります。コマンドの後に管理者パスワードを求める画面が表示される場合は、パスワードを入力して、「return」または「Enter」キーを押してください。
ターミナルを開きます (「ユーティリティ」フォルダにあります)。 次のコマンドを入力して、「return」または「Enter」キーを押します。
1 sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
次のコマンドを入力して、「return」または「Enter」キーを押します。
1 sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
次のコマンドを入力して、「return」または「Enter」キーを押します。
1 sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
Java SE 6 Web Start を再び有効にするには、次のコマンドを入力して、「return」または「Enter」キーを押します。
1 sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws
追加情報
以下の手順では、上記のコマンドを取り消し、Java 7 を復元します。
Java SE 6 Web Start を無効にするには、以下の手順に従います。 次のコマンドを入力して、「return」または「Enter」キーを押します。
1 sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javaws /usr/bin/javaws
管理者パスワードを求める画面が表示される場合は、パスワードを入力して、「return」または「Enter」キーを押してください。 最新バージョンの Oracle Java 7 JRE をダウンロードし、再インストールして、Java 7 アプレットプラグインを再び有効にします。
インストール方法
FreeBSD RELEESE9.1のインストールは、 さくらインターネットのマニュアルとFreeBSDハンドブックを参考にすればOK。
SSHリモートログイン
ssh接続許可なしにssh接続しようとしたら、エラー出た。
1 $ ssh kyonekura@49.212.142.106
2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
3 @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
4 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5 IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
6 Someone could be eavesdropping on you right now (man-in-the-middle attack)!
7 It is also possible that the RSA host key has just been changed.
8 The fingerprint for the RSA key sent by the remote host is
9 d5:69:6b:a3:05:b4:b6:82:9b:10:e8:72:29:66:ca:be.
10 Please contact your system administrator.
11 Add correct host key in /Users/kyonekura/.ssh/known_hosts to get rid of this message.
12 Offending key in /Users/kyonekura/.ssh/known_hosts:16
13 RSA host key for 49.212.142.106 has changed and you have requested strict checking.
14 Host key verification failed.
解決
"/Users/kyonekura/.ssh/known_hosts" を削除した。 http://studio-kitchen.biz/blog/entry/000047.html
sshdの設定
sshdの設定ファイルパス |
/etc/ssh/sshd_config |
【FreeBSD】SSHでリモートログインを許可する (sshd) - kishiro.com http://www.kishiro.com/FreeBSD/ssh.html
SSH サーバの設定 - Penguin's Campus note http://www14.plala.or.jp/campus-note/vine_linux/server_ssh/sshd_config.html
SSHD_CONFIG (5) - OpenSSH-6.1p1 日本語マニュアルページ http://www.unixuser.org/~euske/doc/openssh/jman/sshd_config.html
を参考にして、sshdの設定をする。
さくらのリモートVNCでのキーマップに注意!
":"の入力は"Shift + q"でできる。
まだsudo環境を導入していないので、いちいちスーパーユーザーsuになって、
とした。(デフォルトで付いているコメントアウト"#"を外したり、yes, noの書き換えをしたり。)
ssh接続をする
ここでyesと入力してReturn。
1 Password:
パスワードを入力してReturn。
1 Last login: Sat Sep 7 06:57:12 2013 from uq1-221-170-28-105.tky.mesh.ad.jp
2 FreeBSD 9.1-RELEASE (GENERIC) #0 r243826: Tue Dec 4 06:55:39 UTC 2012
3
4 Welcome to FreeBSD!
5
6 Before seeking technical support, please use the following resources:
7
8 o Security advisories and updated errata information for all releases are
9 at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
10 for your release first as it's updated frequently.
11
12 o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
13 along with the mailing lists, can be searched by going to
14 http://www.FreeBSD.org/search/. If the doc package has been installed
15 (or fetched via pkg_add -r lang-freebsd-doc, where lang is the
16 2-letter language code, e.g. en), they are also available formatted
17 in /usr/local/share/doc/freebsd.
18
19 If you still have a question or problem, please take the output of
20 `uname -a', along with any relevant error messages, and email it
21 as a question to the questions@FreeBSD.org mailing list. If you are
22 unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
23 manual page. If you are not familiar with manual pages, type `man man'.
24
25 Edit /etc/motd to change this login announcement.
26
27 If you write part of a filename in tcsh,
28 pressing TAB will show you the available choices when there
29 is more than one, or complete the filename if there's only one match.
30 kyonekura@2nd:/home/kyonekura %
と表示されれば、サーバにログイン完了。
パッケージ管理システム
http://ja.wikipedia.org/wiki/パッケージ管理システム#FreeBSD
Ports Collectionのアップデート
5.6. Ports Collection の利用 http://www.freebsd.org/doc/ja/books/handbook/ports-using.html
5.6.1. Ports Collection の準備
を参考に。
$ su Password: # portsnap extract # portsnap fetch # portsnap update
portsの管理とアップデート
公式ドキュメント
5.6. Ports Collection の利用 http://www.freebsd.org/doc/ja/books/handbook/ports-using.html
5.6.5. ports のアップグレード
を参考に。
方法1. portupgradeを使う方法
portupgradeをインストールする。(20分ぐらい覚悟)
途中のオプション
- Options for portupgrade 2.4.10.2,2
- Options for ruby 1.8.7.371,1
- Options for perl 5.14.2_2
- Options for m4 1.4.16_1,1
- Options for help2man 1.40.12
は全てデフォルトで"OK"
方法2. portmasterを使う方法
sudoの導入
(15分ぐらいかかった感じ。測ってはいない)
Options for sudo 1.8.6.p3_1というオプション選択画面が出るが、そのままで先に進む。(よくわからんし。)
さらに、 Options for libiconv 1.14が出るが、構わず"OK"
インストール完了。
kyonekura is not in the sudoers file.
1 kyonekura@2nd:/home/kyonekura % sudo cd
2
3 We trust you have received the usual lecture from the local System
4 Administrator. It usually boils down to these three things:
5
6 #1) Respect the privacy of others.
7 #2) Think before you type.
8 #3) With great power comes great responsibility.
9
10 Password:
11 kyonekura is not in the sudoers file. This incident will be reported.
12 kyonekura@2nd:/home/kyonekura %
この問題に関しては後ほど。
フォルダ構成
/etc/rc.conf <<FreeBSD起動時に起動するソフトウェア一覧
ソフトウェアのインストール・アンインストール
パッケージという概念
パッケージ管理ソフト
ports
homebrew
FreeBSDのアップグレード
FreeBSD 8.1-RELEASEから FreeBSD 8.4-RELEASEへアップグレードしたい
まず、最新のパッチを当てる
先に、以下のコマンドを実行してセキュリティパッチをインストールする。
- freebsd-update fetch
- freebsd-update install
> uname -rs FreeBSD 8.1-RELEASE > sudo freebsd-update fetch Looking up update.FreeBSD.org mirrors... 5 mirrors found. Fetching metadata signature for 8.1-RELEASE from update6.freebsd.org... done. Fetching metadata index... done. Inspecting system... done. Preparing to download files... done. The following files will be added as part of updating to 8.1-RELEASE-p12: /usr/src/lib/libc/gen/libc_dlopen.c WARNING: FreeBSD 8.1-RELEASE HAS PASSED ITS END-OF-LIFE DATE. Any security issues discovered after Wed Aug 1 09:00:00 JST 2012 will not have been corrected. > sudo freebsd-update install Installing updates...install: ///usr/src/lib/libc/gen/libc_dlopen.c: No such file or directory done. >
ここでエラーが出て終わっている。
Installing updates...install: ///usr/src/lib/libc/gen/libc_dlopen.c: No such file or directory
/usr/src/lib/libc/gen/libc_dlopen.c
を追加したいがディレクトリがないらしい。
解決策は、ディレクトリを作ってやればいいらしい。 http://b.mammadov.org/2012/02/libcdlopenc-error-freebsd-update.html
> sudo mkdir /usr/src/lib/libc/gen
すると、うまくいった。
> sudo freebsd-update install Installing updates... done.
マイナーアップデート
8.4-RELEASEにアップデートしたい場合、次のコマンドを実行する。
# freebsd-update -r 8.4-RELEASE upgrade
> sudo freebsd-update -r 8.4-RELEASE upgrade Password: Looking up update.FreeBSD.org mirrors... 5 mirrors found. Fetching metadata signature for 8.1-RELEASE from update5.freebsd.org... done. Fetching metadata index... done. Inspecting system... done. The following components of FreeBSD seem to be installed: kernel/generic world/base world/dict world/doc world/manpages The following components of FreeBSD do not seem to be installed: src/base src/bin src/cddl src/contrib src/crypto src/etc src/games src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin world/catpages world/games world/info world/proflibs Does this look reasonable (y/n)? y Fetching metadata signature for 8.4-RELEASE from update5.freebsd.org... done. Fetching metadata index... done. Fetching 1 metadata patches. done. Applying metadata patches... done. Fetching 1 metadata files... done. Inspecting system... done. Fetching files from 8.1-RELEASE for merging... done. Preparing to download files... ...