3
4

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.

UbuntuをUSBメモリにインストールする

Last updated at Posted at 2018-10-16

概要

Kurento Meidia Serverをインストールするために、UbuntuをUSBメモリにセットアップを行った時の手順

用意するもの

  • PC
  • DVD Drive
  • 16GB USBメモリ (USB3.0 Jet Drive)

Ubuntuのインストール

現在のところKurento ServerがサポートするOSは、
Ubuntu 14.04か16.04のみ。今回は16.04をインストールする。

Ubuntu 16.04は、現在はトップページからはダウンロードできないので、
ftp://ftp.riken.jp/Linux/ubuntu-releases/ から
ubuntu-16.04.4-desktop-amd64.iso を取得した。

ダウンロードした.isoファイルをDVDに焼いてUbuntuのインストールディスクを作成する。
USBメモリをPCに挿して、PCをDVDから起動する。

Ubuntuインストール時の設定

[Install Ubuntu]を選択 →
Welcome画面で[English]を選択 → Continue →
[Download updates while installing Ubuntu]にチェック → Continue →
Installation type画面で[Something else]を選択 → Continue →

Device for boot loader installation: で、USB Driveを示す/dev/sdbを指定する。/dev/sdb 上に以下の構成でパーティションを作成する。 → Install Now → Continue

  • /dev/sdb1 ext4 15GB, mount point = '/'
  • /dev/sdb2 swap 1GB

Where are you で Tokyo → Continue →
Keyboard Layout で Japanese, Japanese →

Who are youでusername、hostname、パスワードを設定する。ここでは、ホスト名は"ubu"とした。Require my password to log inをチェック → Continue →
しばし待つ → Restart now (この時点でDVDを取り出して置く)

[Ubuntu]で起動 → パスワードを入力してログインできたらイントール完了

パッケージのインストール

ターミナルからパッケージのアップデート

$ sudo apt-get update
$ sudo apt-get -y upgrade

vim, ssh server, ftp serverのインストールと設定

$ sudo apt-get install -y vim openssh-server vsftpd

SSHの設定

SSH鍵認証フォルダ設定

$ cd ~
$ mkdir .ssh
$ chmod 700 .ssh

サーバーへ鍵を転送する(サーバーに接続したいリモートPC側のコマンド)

$ scp ~/.ssh/id_rsa.pub user@host_ip:~/.ssh

サーバーで鍵の設定

$ cd ~/.ssh
$ cat id_rsa.pub >> authorized_keys
$ chmod 600 authorized_keys
$ rm -fv hoge_rsa.pub

SSH Configファイルの設定。rootログインの禁止、パスワードログイン禁止

/etc/ssh/sshd_config
$ sudo vi /etc/ssh/sshd_config
------- (以下の2行をそれぞれ編集)
PermitRootLogin no
PasswordAuthentication no
-------

SSHサーバーの再起動

$ sudo service sshd restart

リモートPCからサーバーへSSH接続(初回のみ -iオプションで鍵を指定する)

$ ssh -i ~/.ssh/id_rsa user@host_ip

リモートPCの.ssh/configファイルに以下を追加すると、$ ssh ubuと入力するとSSHログインができるようになる。

Host ubu
  HostName 	<host_ip>
  User		<username>

SSHの設定ができたので、以降の設定は全てリモートPCから作業できる。

FTPサーバーの設定

Atomエディタのremote-ftpを使ってサーバー内のファイルが編集できるようにするためにFTPサーバーの設定を行う。
(参考URL https://www.server-world.info/query?os=Ubuntu_16.04&p=ftp )

/etc/vsftpd.confの設定

$ sudo vi /etc/vsftpd.conf
---------- (以下を設定)
write_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ls_recurse_enable=YES
seccomp_sandbox=NO
----------
$ sudo service vsftpd restart

gitのインストールと初期設定

$ sudo apt-get install -y git
$ git config --global user.name "Your Name"
$ git config --global user.email "username@example.com"

javaとmavenのインストール

$ sudo apt-get install -y openjdk-8-jdk
$ sudo apt-get install -y maven
$ sudo sh -c "echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64' >> /etc/profile.d/jdk.sh"
$ sudo sh -c "echo 'export PATH=\$JAVA_HOME/bin:\$PATH' >> /etc/profile.d/jdk.sh"
$ source /etc/profile.d/jdk.sh

サーバーを再起動して設定を再確認

$ sudo reboot
  • リモートPCからSSHでログインできること
  • リモートPCのAtomエディタからホームディレクトリ以下のファイルが編集できること。
  • JAVAの環境変数が設定されていること。
$ echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
$ echo $PATH
...:/usr/lib/jvm/java-8-openjdk-amd64/bin:...
$ javac -version
javac 1.8.0_171

以上で、Ubuntuのセットアップが完了。続いて、Kurentoのインストールを行う。

3
4
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
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?