安装和使用 ubuntu 服务器
生活随笔
收集整理的這篇文章主要介紹了
安装和使用 ubuntu 服务器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Ubuntu
- 本地開發使用最好安裝 ubuntu desktop 版本
- 安裝好后,先切換 apt source 為 阿里云mirror: http://mirrors.aliyun.com/ubuntu
- ubuntu 網絡工具是 ip, 遠程登錄需要開啟ssh server,然后通過 ip address 中的ip地址進行登錄
VPC 遠程登錄
- 服務器開啟 VNC server
-
客戶端配置
客戶端可以選擇 TigerNVC 客戶端,也可以使用 realvnc 的客戶端- realvnc 的客戶端下載地址: https://www.realvnc.com/en/connect/download/viewer/linux/ ,然后連接 ip:5901
- 在 https://github.com/TigerVNC/tigervnc/releases 下載 tigervnc 的客戶端,然后連接 ip:5901
-
參考:https://www.linuxrumen.com/rmxx/1871.html
卸載 Snap 商店
Snap 商店目前非必需產品,先卸載,后續有需求再安裝
- 參考:https://zhuanlan.zhihu.com/p/511438456
- 當出現無法卸載 snap 中的core 時,參考 https://blog.csdn.net/a12355556/article/details/124323495
- 下載PPA 軟件倉庫可能會很慢,感謝中科大代理PPA地址: launchpad.proxy.ustclug.org , https://www.jianshu.com/p/3a030350d2cd
安裝中文輸入法
- 最新版本已經安裝了 ibus, 然后安裝輸入法 sudo apt install ibus-libpinyin,再啟用就好了, https://blog.csdn.net/sofa_r/article/details/126118363
- 通過Keyboard - InputSource 來安裝 Chinese(Intelligent Pinyin)輸入法
- 通過 Shift 切換中英文
在MAC 連接Ubuntu 機器的時候,需要在 Iterm2 中取消自動設置 locale 的配置:
Terminal -> Preferences -> Profiles -> Default>Terminal>Environment>Set locale
安裝docker
- 安裝Docker: sudo apt install docker.io
- 安裝 docker-compose: sudo apt install docker-compose
- Docker pull限速
- Docker Hub 現在限制了pull 速度,https://docs.docker.com/docker-hub/download-rate-limit/?spm=a2c4g.11186623.0.0.19e6296aBu1Vud
- 使用加速器有時候也會失敗:https://help.aliyun.com/document_detail/60750.html
- 根據官方說明,下次可以試一下 docker login之后的效果
- 打印 Docker debug 日志。 在 /etc/docker/daemon.json 增加 "debug": true 參數,然后重啟docker sudo systemctl restart docker,再查看 docker 日志: journalctl -u docker.service | vim -
安裝 aria2 + ariang
version: "3"services:ariang:image: hurlenko/aria2-ariangcontainer_name: aria2-ariangports:- 8081:8080volumes:- /home/kunwan/Downloads/aria2_data:/aria2/data# - /etc/aria2:/aria2/confenvironment:- PUID=1000- PGID=1000- RPC_SECRET=xxx- BASIC_AUTH_USERNAME=kunwan- BASIC_AUTH_PASSWORD=xxx- ARIA2RPCPORT=443restart: always頁面訪問時,如果出現 authorization failed 問題,需要到 AriaNg -> RPC -> Aria2 RPC Secret Token 中重新設置一下RPC_SECRET
安裝vscode
sudo dpkg -i code_1.62.0-1635954068_amd64.deb
NFS服務
安裝配置 NFS
sudo apt install nfs-kernel-serversudo vim /etc/exports/Downloads/aria2_data 192.168.0.0/16(rw,sync,no_root_squash,insecure,no_subtree_check) /Downloads/qbittorrent_data 192.168.0.0/16(rw,sync,no_root_squash,insecure,no_subtree_check)配置選項說明
- rw: This option gives the client computer both read and write access to the volume.
- sync: This option forces NFS to write changes to disk before replying. This results in a more stable and consistent environment since the reply reflects the actual state of the remote volume. However, it also reduces the speed of file operations.
- no_subtree_check: This option prevents subtree checking, which is a process where the host must check whether the file is actually still available in the exported tree for every request. This can cause many problems when a file is renamed while the client has it opened. In almost all cases, it is better to disable subtree checking.
- no_root_squash: By default, NFS translates requests from a root user remotely into a non-privileged user on the server. This was intended as security feature to prevent a root account on the client from using the file system of the host as root. no_root_squash disables this behavior for certain shares.
Mac 連接
Finder -> Go -> Connect Server -> nfs://IP/Downloads/aria2_data
TFTP 服務
安裝和配置 TFTP 共享目錄以及權限
sudo apt-get install tftpd-hpachmod 777 tftp_data sudo vim /etc/default/tftpd-hpaTFTP_USERNAME="tftp" TFTP_DIRECTORY="tftp_data" TFTP_ADDRESS=":69" TFTP_OPTIONS="-l -c -s" # 原本的--secure,替換成上面的-l -c -s,這里是選項,-c是可以上傳文件的參數,-s是指定tftpd-hpa服務目錄然后重啟 sudo systemctl restart tftpd-hpa 服務
客戶端使用tftp
[1] tftp ${FTP_SERVER} tftp> put b.txt tftp> get a.txtfilebrowser 安裝
mkdir -p /data/filebrowser touch /data/filebrowser/filebrowser.db注意
- db 文件需要提前創建一個空文件
- setting 文件不需要創建,直接使用默認的就可以
- container啟動后,使用 admin / admin 登錄,然后修改密碼
Docker 方式啟動
sudo docker run \-v /home/kunwan/Download:/srv \-v /data/filebrowser/filebrowser.db:/database/filebrowser.db \-e PUID=$(id -u) \-e PGID=$(id -g) \-p 8080:80 \--restart=always \filebrowser/filebrowser:s6Docker- Compose 方式啟動
sudo UID="$(id -u)" GID="$(id -g)" docker-compose up -dversion: "2.0" services:filebrowser:image: filebrowser/filebrowser:s6container_name: filebrowserrestart: alwaysvolumes:- /home/kunwan/Downloads:/srv- type: bindsource: /data/filebrowser/filebrowser.dbtarget: /database/filebrowser.dbports:- 8083:80environment:- PUID=$UID- PGID=$GID安裝 Minidlna
sudo apt install minidlna sudo vi /etc/minidlna.conf# If you want to restrict a media_dir to a specific content type, you can # prepend the directory name with a letter representing the type (A, P or V), # followed by a comma, as so: # * "A" for audio (eg. media_dir=A,/var/lib/minidlna/music) # * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures) # * "V" for video (eg. media_dir=V,/var/lib/minidlna/videos) # * "PV" for pictures and video (eg. media_dir=PV,/var/lib/minidlna/digital_camera) media_dir=/home/kunwan/Downloads friendly_name=UbuntuDLNA sudo service minidlna restart sudo service minidlna force-reloadFC 游戲模擬器
sudo apt-get install fceux
總結
以上是生活随笔為你收集整理的安装和使用 ubuntu 服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Secureboot概念进阶版
- 下一篇: 本地搭建Wooyun漏洞库(二)——Ub