還在用Linux命令行?Windows 10 Ubuntu子系統(tǒng)圖形管理工具Webmin來了!


我的玩轉(zhuǎn)WSL系列文章(更新中)

Webmin是什么

今天折騰的主題是:給WSL安裝圖形管理工具Webmin。

Webmin是目前功能最強大的基于Web的Unix系統(tǒng)管理工具。管理員通過瀏覽器訪問Webmin的各種管理功能并完成相應(yīng)的管理動作。目前Webmin支持絕大多數(shù)的Unix系統(tǒng),這些系統(tǒng)除了各種版本的linux以外還包括:AIX、HPUX、Solaris、Unixware、Irix和FreeBSD等。
  Webmin 讓您能夠在遠(yuǎn)程使用支持 HTTPS (SSL 上的 HTTP)協(xié)議的 Web 瀏覽器通過 Web 界面管理您的主機。這在保證了安全性的前提下提供了簡單深入的遠(yuǎn)程管理。這使得 Webmin 對系統(tǒng)管理員非常理想,因為所有主流平臺都有滿足甚至超出上述需求的 Web 瀏覽器。而且,Webmin 有其自己的“Web 服務(wù)器”,因此不需要運行第三方軟件(比如 Web服務(wù)器)。萬事具備。Webmin 的模塊化架構(gòu)允許您在需要時編寫您自己的配置模塊。除了在此介紹的模塊之外,Webmin 還包括許多模塊。盡管目前我們將主要關(guān)注網(wǎng)絡(luò)服務(wù),但是您會看到,幾乎您系統(tǒng)的每一部分都能夠通過 Webmin 來配置和管理。
(以上介紹文字來自:https://www.wdlinux.cn/old/webmin

安裝Webmin

重要的事說三遍:不要安裝官網(wǎng)的deb安裝包!不要安裝官網(wǎng)的deb安裝包!不要安裝官網(wǎng)的deb安裝包!
我在apt安裝webmin_1.920_all.deb時,卡在uppacking這一環(huán)節(jié),完全沒有反應(yīng),強行終止安裝的后果很嚴(yán)重,修復(fù)安裝取消安裝等各種手段都用了,不管用,apt功能徹底廢了,無法安裝新程序。沒辦法,只有重置系統(tǒng)。好在WSL的備份重置非常簡單,稍后會有一篇文章單獨來講。
不用apt怎么辦,很簡單,直接下載官網(wǎng)的tar文件,解壓,執(zhí)行安裝腳本即可:

# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.920.tar.gz
# gunzip webmin-1.920.tar.gz
# tar xf webmin-1.920.tar
# cd webmin-1.920
# ./setup.sh /usr/local/webmin
***********************************************************************
*            Welcome to the Webmin setup script, version 1.920        *
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin from /home/niuyoucai/webmin-1.920 to /usr/local/webmin ...

***********************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.

Config file directory [/etc/webmin]:  回車
Log file directory [/var/webmin]: 回車

***********************************************************************
Webmin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.

Full path to perl (default /usr/bin/perl):  回車

Testing Perl ...
Perl seems to be installed ok

***********************************************************************
Operating system name:    Ubuntu Linux
Operating system version: 18.04.2

***********************************************************************
Webmin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
 - What port to run the web server on. There must not be another
   web server already using this port.
 - The login name required to access the web server.
 - The password required to access the web server.
 - If the webserver should use SSL (if your system supports it).
 - Whether to start webmin at boot time.

Web server port (default 10000): 回車
Login name (default admin): 回車
Login password: 密碼
Password again: 再次輸入密碼
Use SSL (y/n): y
Webmin does not support being started at boot time on your system.
***********************************************************************
Copying files to /usr/local/webmin ..
..done

Creating web server config files..
..done

Creating access control file..
..done

Inserting path to perl into scripts..
..done

Creating start and stop scripts..
..done

Copying config files..
..done

Creating uninstall script /etc/webmin/uninstall.sh ..
..done

Changing ownership and permissions ..
..done

Running postinstall scripts ..
..done

Enabling background status collection ..
..done

Attempting to start Webmin mini web server..
Starting Webmin server in /usr/local/webmin
..done

***********************************************************************
Webmin has been installed and started successfully. Use your web
browser to go to

  http://Tongfang-V42F:10000/

and login with the name and password you entered previously.

安裝過程中要回答幾個問題,上面都做了標(biāo)記,需要注意Use SSL一定要選“Y”,否則無法用遠(yuǎn)程電腦登陸Webmin。安裝很快結(jié)束,系統(tǒng)里多了兩個文件夾,/usr/local/webmin和/etc/webmin。做兩個啟動停止服務(wù)的快捷命令:

# cd ~
# vi ~/.bash_aliases
追加兩行
alias startwebmin='sudo /etc/webmin/restart'
alias stopwebmin='sudo /etc/webmin/stop'
保存退出
# source .bashrc
startwebmin

安裝完畢,webmin服務(wù)已啟動。

測試Webmin

在另外一臺電腦上打開瀏覽器,地址欄輸入https://服務(wù)器IP:10000,出現(xiàn)下面登陸畫面:


Webmin登陸

用剛才安裝時設(shè)定的密碼登陸,進(jìn)入首頁,顯示系統(tǒng)信息:


系統(tǒng)信息

界面是英文的,在Webmin->Change Language and Theme里改成中文,保存,刷新,效果是醬紫的:
中文界面

Webmin功能強大,幾乎你能想到的Linux功能管理都可以在這里找到,比如進(jìn)程管理:


進(jìn)程管理

再比如SSH服務(wù)配置
ssh config

還有用戶管理,啟動管理,硬件管理等等等等。非常適合不喜歡命令行的Linux小白,比如我。
Webmin本身的配置就非常強大:
Webmin Configuration

在IP訪問控制里,加入遠(yuǎn)程電腦的網(wǎng)卡Mac地址,可以限定可使用Webmin的電腦,保證了安全性,有興趣可以試一下。

卸載Webmin

如果體驗過后新鮮勁兒過了,想卸載,也非常簡單,一個命令即可:

# cd /etc/webmin
# ./uninstall.sh

好了,今天的折騰到此結(jié)束!歡迎繼續(xù)關(guān)注小牛的《玩轉(zhuǎn)WSL系列》文集!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容