旧的PC安装 Ubuntu
可以参考的例子:
acer上网本安装 Debian 11 ,不选图形界面,选择 SSH server,重启后root登录。
cd /etc/network/
,编辑 vi interfaces
allow-hotplug wlp2s0
auto wlp2s0
iface wlan0 inet dhcp
wpa-conf /etc/wpa.conf
进入 /etc
目录,新建 wpa.conf 文件
touch wpa.conf
wpa_passphrase wifi名称 wifi密码 >> /etc/wpa.conf
启动网卡
ifup wlp2s0
提示没有ifup命令,需要添加PATH
export PATH=$PATH:/sbin
提示已经自动连接wifi
apt-get install sudo
添加 /etc/sudoers 文件写属性
chmod +w /etc/sudoers
编辑 /etc/sudoers ,下面的user是你要添加的用户名
root ALL=(ALL)ALL
user ALL=(ALL)ALL
去掉 /etc/sudoers 文件写属性
chmod -w /etc/sudoers
sudo apt-get install pip
按照主页安装 janeczku/calibre-web
pip install calibreweb
添加 ~/.local/bin/ 到系统 PATH,用 cps
命令启动,本地访问 http://localhost:8083
添加为系统服务: https://github.com/janeczku/calibre-web/wiki/Setup-Service-on-Linux
创建好服务脚本,启动即可
下载到 ~/frpc ,配置 frpc.ini
[common]
server_addr = 远程IP
server_port = 远程端口
token = 密码
####上面都不用改#####
[laodu]
type = tcp ---改成需要配置的通信协议
local_ip = 127.0.0.1 ----本地地址
local_port = 8083 ------本地的端口
remote_port = 30083 ------希望远程的端口
编辑 system 目录下的 frpc.service 文件
ExecStart=/home/laodu/frpc/frpc -c /home/laodu/frpc/frpc.ini
ExecReload=/home/laodu/frpc/frpc reload -c /home/laodu/frpc/frpc.ini
拷贝到系统目录
sudo cp ~/frpc/systemd/frpc.service /usr/lib/systemd/system/
启动服务,并允许开机运行
sudo systemctl start frpc
sudo systemctl enable frpc
现在,外网可以正常访问
拷贝文件使用 scp 命令
scp -vrC folder user@192.168.2.114:/home/user/
参考:https://wiki.e7zl.com/index.php/231.html
以下为旧内容:
sudo vi /etc/network/interfaces
auto wlp2s0
iface wlp2s0 inet static
address 192.168.1.133
netmask 255.255.255.0
gateway 192.168.1.1
wpa-essid YOURWIFI
wpa-psk WIFIPASSWORD
dns-nameservers 202.99.160.68
sudo ifup -v wlp2s0
sudo /etc/init.d/networking restart
1.安装 sudo apt-get install openssh-server
2.修改配置文件,位置在:etc/ssh/sshd_config
3.服务控制:sudo /etc/init.d/ssh start|stop|restart
4.登录服务器:ssh username@192.168.1.133
,退出
logout
5.拷贝文件:scp -r localfolder username@192.168.1.133:remotefolder
sudo apt-get install samba
sudo mkdir /home/share
sudo chmod 777 /home/share
1.保存现有文件
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
2.创建新文件 sudo vi /etc/samba/smb.conf
3.增加以下内容
[myshare]
path = /home/share
available = yes
browsealbe = yes
public = yes
writable = yes
4.创建Samba账户,替换下面的yourusername,根据提示输入密码
sudo touch /etc/samba/smbpasswd
sudo smbpasswd -a yourusername
5.重启Samba sudo systemctl restart smbd.service
7.其他
ssh user@IP
,退出使用
exit
sudo apt-get install mediatomb
默认页面:http://localhost:49152
,配置文件在:/etc/mediatomb/config.xml
aria2 用来下载bt/磁力,配合 webui-aria2,安装方法:
apt-get install aria2
安装和运行 qbittorrent-nox ,本地8080端口,默认用户名admin,密码adminadmin (https://github.com/qbittorrent/qBittorrent/wiki/Running-qBittorrent-without-X-server)
gvfs-smb
,即可在 Thunar 中访问SMB,如
smb://192.168.1.127/myshare/
参考资料
Date: 2020-02-04