冠瑋老師出題:
1. 安裝Ubuntu0,安裝LAMP、SSH、SERVER
2. 設定固定ip為192.168.0.77
設定DNS為168.92.1.1 /168.95.192.1
3. 修改index.html
4. 利用pietty連入server
5. 安裝webmin(在pietty下)改成繁體。
Ubuntu 用user 修改root密碼
第一步:首先用jobshsieh的使用者,修改root的密碼
指令:
sudo passwd root
輸入設定的密碼
su
輸入設定的root密碼
Ubuntu 網路設定 – 固定 IP
指令 vim /etc/network/interfaces
sr1 auto lo
2 iface lo inet loopback
3
4 auto ens33
5 iface ens33 inet static # 固定 (靜態) IP。
6 address 192.168.0.77 # IP 位址。
7 netmask 255.255.255.0 # 網路遮罩。
8 gateway 192.168.0.1 # 預設閘道。
按ESC
:wq!
service networking restart
reboot
Ubuntu 設定 DNS
指令:cd /etc
vim resolv.conf
加入 nameserver 168.95.1.1
nameserver 168.95.192.1
按ESC
:wq!
service networking restart
Ubuntu 修改index.html
在瀏覽器輸入192.168.0.77,查看以下圖中的 /var/www/html/index.html) 位置
指令: cd /var
ls
cd www
ls
cd html
ls
vim index.html
進入後,用指令:dd去刪除不要的,萬一刪除錯誤的話,用指令:u
將index.html 改成以下畫面內容
Ubuntu 修改pietty登入
1.指令: cd /etc/ssh
vim sshd_config
把 PermitRootLogin without-password
改成PermitRootLogin yes
:qw!
2. 重新啟動電腦或重新啟動
(方法一)a. reboot
(方法二)b. cd /etc/init.d/
service ssh restart
3.執行pietty 輸入192.168.0.77即可
輸入root 和密碼後,出現以下畫面,代表成功
Ubuntu 安裝webmin並改成繁體顯示
Webmin 是一個網頁介面的 UNIX 管理工具, 可以進行管理系統帳號, 磁碟, 網路, 防火牆, 排程, Apache, DNS, 檔案分等等, 以下是 Debian 及 Ubuntu 安裝 Webmin 的方法:
首先加入 Webmin 官方 repository, 開啟檔案 /etc/apt/sources.list
# vi /etc/apt/sources.list
加入以下兩行:
1 2 | deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib |
然後取得以上 repository 的 GPG key:
# cd /root
# wget http://www.webmin.com/jcameron-key.asc
# apt-key add jcameron-key.asc
加入 Webmin 的 repository 後, 用安就很簡單了, 更新 apt-get 就可以開始安裝了:
# apt-get update
# apt-get install webmin
Webmin 預設使用 10000 埠號, 設定 firewall 開通 10000 埠號:
# ufw allow 10000
Webmin 預設使用的埠號是 10000, 可以這樣存取:
http://localhost:10000
或
https://localhost:10000
如果要更改 Webmin 的埠號, 可以用 root 登入 Webmin 後, 按 Webmin -> Webmin Configuration -> Ports and Addresses… 到那裡更改。