Ubuntu Server 18.04.1では、”/swap.img” というファイルがスワップとして使用されている。パーティションでもなく、ファイルがSWAPの領域なので柔軟といえば柔軟か。
“swapon -s” コマンドで現在のスワップの状態を確認できる。
スワップをOFFにする場合は、”swapoff” コマンドで無効化できる。
Ubuntu Server 18.04.1では、”/swap.img” というファイルがスワップとして使用されている。パーティションでもなく、ファイルがSWAPの領域なので柔軟といえば柔軟か。
“swapon -s” コマンドで現在のスワップの状態を確認できる。
スワップをOFFにする場合は、”swapoff” コマンドで無効化できる。
chshコマンドでログインシェルを変更する(chang login shell)
sudo chsh ユーザ名
実行すると、ログインシェルを問われるので、新しいシェルを指定する。
~$ sudo chsh web-user
Changing the login shell for web-user
Enter the new value, or press ENTER for the default
Login Shell [/bin/bash]:
ユーザのプライマリグループは、usermod の-gオプションで実行する。
sudo usermod -g グループ名 ユーザ名
プライマリグループの確認は、groupsコマンドで確認する。1つ目のグループがプライマリグループ。
~$ groups zen zen : developers sudo
vsftpdで何も考えずに、SSLの設定をすると、明示的な暗号化(Explicit)になる。
# This option specifies the location of the RSA certificate to use for SSL # encrypted connections. rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key ssl_enable=YES
そのため、FTPSで接続する場合は、明示的な暗号化をクライアントソフト側で選ぶ。その場合のポートは、21番ポートが待ち受けになる。
暗黙的な暗号化(Implicit)にするためには、以下のようなimplicit_sslを有効化して、ポートの設定が必要。
implicit_ssl=YES listen_port=990
aptでインストールしたパッケージの一覧を表示するには、下記のコマンドを実行する。
apt list --installled
実行例)
zen:/var/log$ apt list --installed Listing... Done accountsservice/bionic,now 0.6.45-1ubuntu1 amd64 [installed] adduser/bionic,bionic,now 3.116ubuntu1 all [installed] adwaita-icon-theme/bionic,bionic,now 3.28.0-1ubuntu1 all [installed,automatic] amd64-microcode/bionic-updates,now 3.20180524.1~ubuntu0.18.04.2 amd64 [installed,automatic] apparmor/bionic-updates,bionic-security,now 2.12-4ubuntu5.1 amd64 [installed] apt/bionic-updates,now 1.6.8 amd64 [installed] apt-utils/bionic-updates,now 1.6.8 amd64 [installed]
ubuntu 18.04.02で、Nginx-fullをインストールしたときにインストールされているオプション。
“–with-http_ssl_module” と “–with-http_v2_module” がついているので、SSL化もHTTP/2化もすんなりとできる。
zen:/var/log$ nginx -V nginx version: nginx/1.14.0 (Ubuntu) built with OpenSSL 1.1.0g 2 Nov 2017 TLS SNI support enabled configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-FIJPpj/nginx-1.14.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-FIJPpj/nginx-1.14.0/debian/modules/http-auth-pam --add-dynamic-module=/build/nginx-FIJPpj/nginx-1.14.0/debian/modules/http-dav-ext --add-dynamic-module=/build/nginx-FIJPpj/nginx-1.14.0/debian/modules/http-echo --add-dynamic-module=/build/nginx-FIJPpj/nginx-1.14.0/debian/modules/http-upstream-fair --add-dynamic-module=/build/nginx-FIJPpj/nginx-1.14.0/debian/modules/http-subs-filter
Ubuntuでユーザをグループに追加するには、usermod -aGコマンドを使用する。 “-a”オプションも使用しないと、グループに追加されるわけではなく、副グループが切り替わってしまうので、注意。
sudo usermod -aG グループ名 ユーザ名
実行例)
$ sudo usermod -aG developers zen $ groups zen sudo developers
下記のように、aptの公開鍵を追加しようとしたところ、エラーが出た。
zen:~$ sudo curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xF1656F24C74CD1D8" | sudo apt-key add E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
gnupgがインストールされていないのが、原因なので、aptでインストール。
sudo apt install gnupg
gnupgのインストール後に、再度、試したところ、正常にapt公開鍵の追加が完了した。
Ubuntu Server 18.04 には、ifconfigがインストールされていないので、ipコマンドを使用する。
IPアドレスの確認であれば、”ip addr” で確認できる。
ip addr
ifconfigがなくなるとは。。。
Ubuntu 18.04 でvCenter Server 6.7 をインストールするために、インストーラをダブルクリックしたが、起動しない。 パスの問題かもしれないので、ターミナルからインストーラを起動させてみたところ、下記のエラーが表示された。
zen@vCenterServer67:/media/zen/VMware VCSA/vcsa-ui-installer/lin64$ ./installer ./installer: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
インストールに必要な「libgconf2-4」がUbuntu上にインストールされておらず、起動しないようだ。 なので、aptを使ってインストールする。
念のため、パッケージがあるかどうかを確認してから、インストール。
apt search libgconf2 sudo apt install libgconf2-4
正常にlibgconf2-4がインストールされた後に、vCenter Serverのインストーラを起動させたところ、正常にGUIが立ち上がった。
zen@vCenterServer67:~$ apt search libgconf2 ソート中... 完了 全文検索... 完了 libgconf2-4/bionic 3.2.6-4ubuntu1 amd64 GNOME 設定データベースシステム (ダミーパッケージ) libgconf2-dev/bionic 3.2.6-4ubuntu1 amd64 GNOME configuration database system (development) libgconf2-doc/bionic,bionic 3.2.6-4ubuntu1 all GNOME configuration database system (API reference) libgconf2.0-cil/bionic,bionic 2.24.2-4 all GConf 2.24 の CLI バインディング libgconf2.0-cil-dev/bionic,bionic 2.24.2-4 all GConf 2.24 の CLI バインディング zen@vCenterServer67:~$ zen@vCenterServer67:~$ zen@vCenterServer67:~$ sudo apt install libgconf2-4 [sudo] zen のパスワード: パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 以下の追加パッケージがインストールされます: gconf-service gconf-service-backend gconf2-common libgconf-2-4 以下のパッケージが新たにインストールされます: gconf-service gconf-service-backend gconf2-common libgconf-2-4 libgconf2-4 アップグレード: 0 個、新規インストール: 5 個、削除: 0 個、保留: 0 個。 847 kB のアーカイブを取得する必要があります。 この操作後に追加で 8,422 kB のディスク容量が消費されます。 続行しますか? [Y/n] Y 取得:1 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 gconf2-common all 3.2.6-4ubuntu1 [700 kB] 取得:2 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 libgconf-2-4 amd64 3.2.6-4ubuntu1 [84.8 kB] 取得:3 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 gconf-service-backend amd64 3.2.6-4ubuntu1 [58.1 kB] 取得:4 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 gconf-service amd64 3.2.6-4ubuntu1 [2,036 B] 取得:5 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 libgconf2-4 amd64 3.2.6-4ubuntu1 [2,044 B] 847 kB を 0秒 で取得しました (3,314 kB/s) 以前に未選択のパッケージ gconf2-common を選択しています。 (データベースを読み込んでいます ... 現在 171039 個のファイルとディレクトリがインストールされています。) .../gconf2-common_3.2.6-4ubuntu1_all.deb を展開する準備をしています ... gconf2-common (3.2.6-4ubuntu1) を展開しています... 以前に未選択のパッケージ libgconf-2-4:amd64 を選択しています。 .../libgconf-2-4_3.2.6-4ubuntu1_amd64.deb を展開する準備をしています ... libgconf-2-4:amd64 (3.2.6-4ubuntu1) を展開しています... 以前に未選択のパッケージ gconf-service-backend を選択しています。 .../gconf-service-backend_3.2.6-4ubuntu1_amd64.deb を展開する準備をしています ... gconf-service-backend (3.2.6-4ubuntu1) を展開しています... 以前に未選択のパッケージ gconf-service を選択しています。 .../gconf-service_3.2.6-4ubuntu1_amd64.deb を展開する準備をしています ... gconf-service (3.2.6-4ubuntu1) を展開しています... 以前に未選択のパッケージ libgconf2-4:amd64 を選択しています。 .../libgconf2-4_3.2.6-4ubuntu1_amd64.deb を展開する準備をしています ... libgconf2-4:amd64 (3.2.6-4ubuntu1) を展開しています... gconf2-common (3.2.6-4ubuntu1) を設定しています ... Creating config file /etc/gconf/2/path with new version libgconf-2-4:amd64 (3.2.6-4ubuntu1) を設定しています ... libc-bin (2.27-3ubuntu1) のトリガを処理しています ... gconf-service (3.2.6-4ubuntu1) を設定しています ... gconf-service-backend (3.2.6-4ubuntu1) を設定しています ... libgconf2-4:amd64 (3.2.6-4ubuntu1) を設定しています ... zen@vCenterServer67:~$