orange pi lite2 開箱與基本設定

買了個orange pi lite 2(俗稱橘子派)當玩具玩玩

沒辦法,樹莓派有點貴…順便在裏頭掛個小刀用用。

官網網址如下:
http://www.orangepi.cn/Orange%20Pi%20Lite%202/index_cn.html

官網上有ubuntu server跟debian jessie以及android的source system,但因android沒有小刀專用server,ubuntu server用起來不穩定,在裝程式時會有遺漏以及錯誤,最後我是選擇jessie。
這玩意跟樹莓派一樣,要裝SD卡才能開機,這邊不提如何把os燒在SD卡裡
燒完開機後,透過serial轉TTL連線

1.先設定WIFI
1.1 ubuntu:wifi設定

vim /etc/network/interfaces

1.2 debian jessie(我的無線網卡是wlan3,請對應自己的無線網卡)

nmcli dev wifi connect "SSID" password "PASSWORD" ifname wlan3

修改ssid與password後,重啟動網卡或重開機,就可以使用

2.修改供 Debian 穩定版使用者的 /etc/apt/sources.list

# Security updates
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

## Debian mirror

# Base repository
deb http://ftp.debian.org/debian jessie main contrib non-free
deb-src http://ftp.debian.org/debian jessie main contrib non-free

# Stable updates
deb http://ftp.debian.org/debian jessie-updates main contrib non-free
deb-src http://ftp.debian.org/debian jessie-updates main contrib non-free

# Stable backports
deb http://ftp.debian.org/debian jessie-backports main contrib non-free
deb-src http://ftp.debian.org/debian jessie-backports main contrib non-free

2.1 修改分區擴容,因為我買的是16G記憶卡,官網上預設燒好的系統並沒完全利用,在以後安裝程式很麻煩,所以修改分區資訊符合需求。

fdisk /dev/mmcblk0
Command (m for help): p

/dev/mmcblk0p1 40960 143359 102400 50M c W95 FAT32 (LBA)
/dev/mmcblk0p2 143360 2457599 2314240 1.1G 83 Linux
2.2 記下mmcblk0p2的起始柱號(這裡是143360)

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.
2.3 新增分區

Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-31116287, default 2048): 143360
Last sector, +sectors or +size{K,M,G,T,P} (143360-31116287, default 31116287): 31116287

注意事項:在分割時輸入起始磁區時,輸入剛才的起始磁區位置
Created a new partition 2 of type ‘Linux’ and of size 14.8 GiB.
2.4 寫入分割表

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
註:這裡不用理會,直接下reboot指令就行
2.5 重啟系統後,resize空間

root@OrangePi:~# reboot
root@OrangePi:~# resize2fs /dev/mmcblk0p2

resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 3871616 (4k) blocks long.

3. 修改remote ssh login,讓user可以透過遠端連線,不受限於serial

vi /etc/ssh/sshd_config
修改 PermitRootLogin yes
/etc/init.d/ssh restart

4. 使用apt-get update;apt-get dist-upgrade更新plugin
5. 安裝小刀三件套
5.1 三件套一次搞定請參考以下網址安裝
https://github.com/dylanbai8/V2Ray_ws-tls_Website_onekey
5.2 安裝完畢後修改
vi /etc/nginx/nginx.conf
拿掉TLS v.1.3設定
vi /etc/nginx/conf.d/v2ray.conf
拿掉http2設定
systemctl start nginx.service
5.3 多用戶的話,請修改config.json,搭配小刀ssid自動申請即可。
vi /etc/v2ray/config.json
修改後重啟v2ray服務即可。