nas虚拟机设置

1 安装zsh插件

kali自己带zsh,也安装了一些插件,再装一些好用的。

1.1 zsh-autosuggestions

1
2
git clone https://gitclone/github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

1.2 autojump

1
2
3
git clone https://github.com/wting/autojump.git
cd autojump
./install.py # or ./uninstall.py

1.3 command-not-found

在.zshrc文件中添加

1
plugins=(command-not-found)

2 换源

sudo vim /etc/apt/sources.list

1
2
3
4
5
清华大学Kali镜像源
把原来的源注释掉

deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free

apt update

3 开通ssh

默认新安装的kali系统会关闭ssh 连接服务,我们通过命令打开:

1
2
3
4
5
6
7
8
9
#启动ssh服务
sudo systemctl start ssh
servicesshstart?

#查看ssh 服务状态
sudo systemctl status ssh

#加入开机启动
sudo systemctl enable ssh

4 中文输入法

kali自己不带中文输入法,要安装一下ibus-pinyin,后面输入法自带小鹤双拼,修改一下就好

1
sudo apt install ibus-pinyin

5 ip地址查询

1
2
3
4
5
6
7
8
9
10
# 请勿用于商业用途,仅供个人测试学习之用,请遵守中国法律法规
# 查询本机外网IPv4地址
curl 4.ipw.cn

# 查询本机外网IPv6地址
curl 6.ipw.cn

# 测试网络是IPv4还是IPv6访问优先(访问IPv4/IPv6双栈站点,如果返回IPv6地址,则IPv6访问优先)
curl test.ipw.cn

6 git clone 无法使用

由于网络原因,git clone无法使用,利用镜像网站加速。

7 文件互传

7.1 使用SFTP

SFTP 是一个通过 SSH(安全外壳协议)加密的文件传输协议,通常用于安全地在本地计算机和远程服务器之间传输文件。

步骤:

在本地计算机上,打开一个终端或命令提示符。 使用以下命令连接到远程服务器: sftp username@your-server-ip 如果用户名有空格可以用: sftp "用户名"@"主机地址"

1
username 是您的远程服务器用户名,your-server-ip 是服务器的 IP 地址。

登录后,可以使用 get 下载文件或使用 put 上传文件: 下载文件:get /remote/path/to/file /local/path/to/save 上传文件:put /local/path/to/file /remote/path/to/save 完成后,使用 exit 退出 SFTP 会话。

7.2 使用绿联云

在绿联nas上选择文件,共享,然后在虚拟机上用浏览器下载。

8 科学上网

找梯子啊这个网站可以,内容比较丰富! 新安装的kali,无法访问GitHub,在安装一些软件的时间无法安装,比如lazyvim。在桌面安装支持订阅的软件后,浏览器可以科学上网,但是终端不行。 所以解决方案是,在桌面的时候用订阅软件比如Clash Verge,在终端的时候用终端版的Clash。

8.1 终端设置

可能桌面开了代理,但是终端连不上代理。这个时候就要对终端进行设置了。 开启代理后,设置.zshrc or .bashrc,加入命令:

1
2
export http_proxy=http://proxy.example.com:8080
export https_proxy=http://proxy.example.com:8080

sources zsh一下

但可能安装了vpn以后也无法访问GitHub,那么先看一下系统的proxy,

1
env | grep -E 'http_proxy|https_proxy'

然后vim ~/.gitconfig

1
2
3
4
[https]
proxy = http://127.0.0.1:7897(系统的proxy)
[http]
proxy = http://127.0.0.1:7897(系统的proxy)

8.2 机场订阅源

坚持原创技术分享,您扫一扫将鼓励我继续写作!