ラベル webmin の投稿を表示しています。 すべての投稿を表示
ラベル webmin の投稿を表示しています。 すべての投稿を表示

2013年4月6日土曜日

Webmin ログイン画面のカスタマイズ


Webmin標準のログイン画面のメッセージの変更やIPアドレスを非表示にする手順をまとめます。

OS: CentOS 6.4(64-bit)
Webmin: 1.620


■ログイン画面のメッセージを変更
[root@centos64 ~]# cd /usr/libexec/webmin/lang [root@centos64 lang]# cp -p en en.org [root@centos64 lang]# vi en [root@centos64 lang]# diff en en.org 131,132c131,132 < session_header=Login to Change Password < session_mesg=You must enter a username and password to login to the Webmin server. --- > session_header=Login to Webmin > session_mesg=You must enter a username and password to login to the Webmin server on $1. [root@centos64 lang]#
131行目のsession_headerの値および132行目のsession_mesgの値を修正。

■ログイン画面のボックスのサイズ変更し、リンク追加
[root@centos64 ~]# cd /usr/libexec/webmin/ [root@centos64 webmin]# cp -p session_login.cgi session_login.cgi.org [root@centos64 webmin]# vi session_login.cgi [root@centos64 webmin]# diff session_login.cgi session_login.cgi.org 62c62 < "width=60% class='loginform'", 2); --- > "width=40% class='loginform'", 2); 91,92d90 < print "<br /><a href=\"https://54.249.xxx.xxx:81/re-issued_password.html\" target=\"_blank\">"; < print "<b>Forgot your password?</b></a><br />\n"; [root@centos64 webmin]# [root@centos64 webmin]# head -93 session_login.cgi | tail -4 print &ui_form_end(); print "<br /><a href=\"https://54.249.xxx.xxx:81/re-issued_password.html\" target=\"_blank\">"; print "<b>Forgot your password?</b></a><br />\n"; print "</center>\n"; [root@centos64 webmin]#
リンクの追加は、&ui_form_end()と</center>の間が適当です。
※表示の都合上、一部”<”と”>”に置き換えています。



■ログイン画面確認

Webminの再起動等は不要で変更が即時反映されます。

以上です。何かのお役にたてれば幸いです。

2013年3月29日金曜日

Webminを利用してブラウザからユーザパスワード変更


Webminを利用すればLinuxのOSユーザのパスワードをブラウザから変更することが
可能ですが、それ以外の操作はさせたくない場合の設定方法をまとめます。

OS: CentOS 6.4(64-bit)
Webmin: 1.620


■ユーザ作成
あらかじめOSユーザを作成しておく必要があります。
※OSユーザ一括生成はこちらを参照。
今回はuseraddコマンドでユーザ作成します。
[root@centos64 ~]# groupadd -g 600 public [root@centos64 ~]# useradd -g 600 -u 6001 user01 [root@centos64 ~]# useradd -g 600 -u 6002 user02 [root@centos64 ~]# passwd user01 [root@centos64 ~]# passwd user02

■設定概要
1) ブラウザよりWebminにrootログイン 2) Webminユーザを作成 3) Webminユーザの編集でパスワードの変更のアクセス制御オプションを設定 4) 作成したユーザでログインしてパスワードの変更確認

■Webminユーザ作成
Webmin → Webminユーザ → 新しいWebminユーザを作成


■Webminユーザの作成
「user01」を作成する。

※変更箇所のみ
▼Webminユーザのアクセス権
 ユーザ名: OSで作成したユーザ
 パスワード: Unix認証
 本名: 適当に
▼ユーザインターフェイス設定
 言語: Japanese(JA_JP.UTF-8)
 パーソナルテーマ: MSC.LinuxTheme
▼使用可能な Webmin モジュール
 パスワードの変更にチェック(それ以外はチェックしない)

作成ボタンクリック

■Webminユーザ

↑作成したユーザ(user01)をクリック

■Webminユーザの編集

↑パスワードの変更をクリック

■モジュールのアクセス制御

パスワードの変更のアクセス制御オプション(変更箇所のみ)
 Users whose passwords can be changed: Only this user
 Can force users to change password at next login?: いいえ
 Change password in other modules?: いいえ

保存ボタンをクリック

■Webminユーザの編集

▼Permissions for all modules(変更箇所のみ)
 ファイル選択の root ディレクトリ: User's home directory
 Can send feedback email?: No
 Grant new module permissions to user?: いいえ
 Show Webmin search field?: いいえ

保存ボタンをクリック
その後ログアウト


■作成したユーザでログイン

ここのメッセージを変更することも可能です。IPアドレスとか表示させたくない場合も
考えられますし・・・。設定方法は後日まとめます。

■パスワードの変更



これで画面上からOSユーザのパスワードの変更ができています。

以上です。
前半の設定になりますが、ユーザインタフェイス設定のパーソナルテーマに
MSC.LinuxThemeを選択するところがポイントでしょうか。
画面イメージが変わりますが、システム情報が表示される画面を無くすことができます。

何かのお役にたてれば幸いです。

2013年3月23日土曜日

Webminのセキュリティ対策 SSL化とポート番号変更


WebminはWebブラウザからほぼすべてのOS設定が可能なため、アクセス等のセキュリティ対策
が重要です。少なくともデフォルトポートを変更し、SSL化してhttpsでの接続を推奨します。
そのための手順をまとめます。

OS: CentOS 6.3(64-bit)
Webmin: 1.620


■SSLインストール
[root@centos64 ~]# yum -y install mod_ssl openssl ======================================================================== Package Arch Version Repository Size ======================================================================== Installing: mod_ssl x86_64 1:2.2.15-26.el6.centos base 90 k Updating: openssl x86_64 1.0.0-27.el6_4.2 updates 1.4 M Transaction Summary ======================================================================== Install 1 Package(s) Upgrade 1 Package(s) (以下省略) [root@centos64 ~]# [root@centos64 ~]# /etc/init.d/httpd restart
SSLを有効化するためにhttpdを再起動。

■Net::SSLeayインストール
ブラウザでWebminにログイン
左側メニューの、Webmin → Webmin設定 → SSL暗号化


download and installのリンクからNet::SSLeayをインストール


再びSSL暗号化画面にてSSLを使用可能にする。


SSLが使用可能になるとhttpでのアクセスは拒否されるようだ。

Webブラウザでアクセスすると https://192.168.77.148:10000/ でログイン画面が表示される。




■デフォルトのポート番号を変更
[root@centos64 ~]# cd /etc/webmin/ [root@centos64 webmin]# cp -p miniserv.conf miniserv.conf.org [root@centos64 webmin]# vi miniserv.conf [root@centos64 webmin]# diff miniserv.conf miniserv.conf.org 1c1 < port=4649 --- > port=10000 16c16 < listen=4649 --- > listen=10000 [root@centos64 webmin]#
1行目と16行目を修正。ポート番号を10000から4649に変更。
その後Webminを再起動
[root@centos64 webmin]# /etc/init.d/webmin restart Stopping Webmin server in /usr/libexec/webmin Starting Webmin server in /usr/libexec/webmin Pre-loaded WebminCore [root@centos64 webmin]#

Webブラウザで https://192.168.77.148:4649/ にアクセスするとログイン画面が表示される。


以上です。何かのお役に立てれば幸いです。

2013年3月22日金曜日

CentOS 6.4にWebminインストール


WebminはUnix系OSのシステム管理用のWebベースのインターフェイスです。
Webブラウザを使用して、ユーザアカウント、Apache、DNS、ファイル共有等を
セットアップすることができます。
※ http://www.webmin.com/ の What is Webmin? を直訳しただけです。

OS: CentOS 6.3(64-bit)
Webmin: 1.620


■リポジトリ設定(webminはデフォルトリポジトリに登録されていないので)
[root@centos64 ~]# vi /etc/yum.repos.d/webmin.repo [root@centos64 ~]# cat /etc/yum.repos.d/webmin.repo [webmin] name=Webmin Distribution Neutral mirrorlist=http://download.webmin.com/download/yum/mirrorlist enabled=0 [root@centos64 ~]#

■jcameron-key.ascのインポート
[root@centos64 ~]# wget http://www.webmin.com/jcameron-key.asc [root@centos64 ~]# ll jcameron-key.asc -rw-r--r-- 1 root root 1320 12月 5 09:58 2002 jcameron-key.asc [root@centos64 ~]# rpm --import jcameron-key.asc [root@centos64 ~]#

■yumでインストール
[root@centos64 ~]# yum --enablerepo=webmin -y install webmin ======================================================================== Package Arch Version Repository Size ======================================================================== Installing: webmin noarch 1.620-1 webmin 21 M Transaction Summary ======================================================================== Install 1 Package(s) Total download size: 21 M (以下省略) [root@centos64 ~]#

■※インストール直後は起動している。
[root@centos64 ~]# /etc/init.d/webmin status Webmin (pid 3030) is running [root@centos64 ~]#



■ブラウザでアクセス
※httpdを起動させておく必要がある。
http://192.168.77.148:10000/
Username: root
Password: rootのパスワード

■日本語表示設定
左側メニューの、Webmin → Change Language and Theme
Webmin UI Language を Japanese (JA_JP.UTF-8)に変更してMake Changesボタンをクリック。


以上です。何かのお役に立てれば幸いです。

2012年4月13日金曜日

CentOS 5.5 Webmin インストール等々

Webminは言わずと知れたブラウザからLinuxOSの各種設定を行うツールです。
インストール方法および、簡単な初期設定をまとめてみました。

■構成情報
・Operating system CentOS Linux 5.5 
・Webmin version 1.580 


■リポジトリ設定(webminはデフォルトリポジトリに登録されていないので)
[root@web01 ~]# vi /etc/yum.repos.d/webmin.repo
[root@web01 ~]# cat /etc/yum.repos.d/webmin.repo
[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1
[root@web01 ~]# 

■jcameron-key.ascのインポート
[root@web01 ~]# wget http://www.webmin.com/jcameron-key.asc
(中略)
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 1320 (1.3K) [text/plain]
`jcameron-key.asc' に保存中

100%[=====================================>] 1,320     --.-K/s 時間 0s

2012-04-12 23:58:57 (69.9 MB/s) - `jcameron-key.asc' へ保存完了 [1320/1320]

[root@web01 ~]# rpm --import jcameron-key.asc
[root@web01 ~]#

■yumでインストール
[root@web01 ~]# yum install webmin
(中略)
======================================================================
 Package                 Arch        Version      Repository     Size
======================================================================
Installing:
 webmin                  noarch      1.580-1      Webmin         16 M

Transaction Summary
======================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 16 M
Is this ok [y/N]: y
Downloading Packages:
webmin-1.580-1.noarch.rpm                            |  16 MB     00:08
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Operating system is CentOS Linux
  Installing     : webmin                                           1/1
Webmin install complete. You can now login to https://web01:10000/
as root with your root password.

Installed:
  webmin.noarch 0:1.580-1

Complete!
[root@web01 ~]#

■デフォルトのポート番号を変更するには
[root@web01 ~]# vi /etc/webmin/miniserv.conf
[root@web01 ~]# grep -n -e port -e listen /etc/webmin/miniserv.conf
1:port=4649
16:listen=4649
[root@web01 ~]# /etc/init.d/webmin restart
Stopping Webmin server in /usr/libexec/webmin
Starting Webmin server in /usr/libexec/webmin
Pre-loaded WebminCore
[root@web01 ~]#
ブラウザにてhttps://192.168.xxx.110:4649/ にアクセス。
※AWSの場合はセキュリティーグループでポートの解放を忘れずに。
■日本語化 左側メニューの、Webmin → Change Language and Theme Webmin UI Language を Japanese (JA_JP.UTF-8)に変更して Make Changesボタンをクリック。
■Text Loginのコンソールエリアを少し大きくする [root@web01 ~]# vi /usr/libexec/webmin/ajaxterm/ajaxterm/ajaxterm.html [root@web01 ~]# grep -n Terminal /usr/libexec/webmin/ajaxterm/ajaxterm/ajaxterm.html 12: t=ajaxterm.Terminal("term",94,30); [root@web01 ~]# /etc/init.d/webmin restart Stopping Webmin server in /usr/libexec/webmin Starting Webmin server in /usr/libexec/webmin Pre-loaded WebminCore [root@web01 ~]#
※これ以上大きくするとスクロールバーが表示されてしまう。