ifconfig 會出現下面兩個網路介面,需要注意他們的 inet(IP位置)
enp0s3: 可以轉介面讓網路連到
enp0s8: 可以連到windows(使用putty和WinSCP連接要用的介面 IP位置)
使用putty免費軟體,進行SSH遠端操作(enp0s8: windows對linux操作)
WinSCP(上傳下載檔案到Linux)選擇SFTP也可以連到虛擬機(enp0s8)
管理員提示符號: #、一般使用者提示符號: $
安裝軟體每個系統指令會不一樣,Linux的core都一樣,但是每個系統的安裝軟體跟一些shell不一樣,安裝需要管理員權限
先ping 8.8.8.8看有沒有連到網路,如果還是不行,就用指令查看防火牆有沒有關
yumaptyum install httpd
systemctl start httpd // 啟動http伺服器,架設在enp0s8上
systemctl status httpd
上面是建立在私有網路底下
python3 http server
IPv6架設網路
需要網路支援IPv6,只要拿到IPv6的
連IPv6需要加上[]:
http://[2001:b400:e757:3dc5:cdfd:d051:8826:4da2]:8888/hi.htm
dynv6 網站可以把IPv6網址轉成domain name
windows: python -m httpserver 8888: 在port 8888開啟server
clear: 清除螢幕畫面
systemctl [action] [server]: 可以啟動服務,這個命令需要root權限 su
action: start、stop、restart、status、disable、enable
server: httpd、sshd、firewalld
systemctl status firewalld // 查看防火牆狀態
systemctl disable firewalld // 之後開機防火牆都會關閉
systemctl stop firewalld // 防火牆馬上關閉
// 後面的 d 代表 daemon (守護進程)
getenforce: 確認Linux強大的防火牆有沒有開啟,如果SELINUX選項是enforce,就會讓其他人無法連到,需要跟改系統文件內容
gedit /etc/selinux/config : 使用圖形化界面修改文件SELINUX=disabledsetenforce 0: 可以暫時關掉上面的防火牆
mv file path: 移動資料夾到檔案位置
mv test.html /var/www/html: 把檔案丟到網站上面echo "hi" > hello.htm: 把”hi”丟到hello.htm裡面(取代內容)
echo: 功能像是print,把內容打在終端> : 重新定向,將file文件重定向為輸出源,建立新模式cat hello.htm: 取得檔案內容,顯示在終端上 (windows用more)curl http://127.0.0.1:6666: curl是文字版的網站,可以測試網站是否可以運行