FreeBSD初始化
终端程序安装
完成FreeBSD初步安装之后,执行
安装运维软件:
安装运维软件
# 如果保持物理主机纯净,将所有日常工作、开发和维护环境都迁移到虚拟机和Jail中,那么只安装以下最少软件
# tmux 建议同时安装 terminfo-db 以获取terminfo数据库
pkg install sudo tmux terminfo-db
# 如果直接在物理主机工作,可以补充安装git等工具
# pkg install sudo tmux terminfo-db bash git-lite tree
这里有一个 GitWeb 提示对于在FreeBSD上运行简易的git WEB访问有帮助:
Message from git-lite-2.49.0:
--
If you installed the GITWEB option please follow these instructions:
In the directory /usr/local/share/examples/git/gitweb you can find all files to
make gitweb work as a public repository on the web.
All you have to do to make gitweb work is:
1) Please be sure you're able to execute CGI scripts in
/usr/local/share/examples/git/gitweb.
2) Set the GITWEB_CONFIG variable in your webserver's config to
/usr/local/etc/git/gitweb.conf. This variable is passed to gitweb.cgi.
3) Restart server.
If you installed the CONTRIB option please note that the scripts are
installed in /usr/local/share/git-core/contrib. Some of them require
other ports to be installed (perl, python, etc), which you may need to
install manually.
(放弃,感觉csh也好)修改
admin
用户默认使用 Bash 作为SHELL:
设置bash作为SHELL
chsh -s /usr/local/bin/bash admin
创建admin账号以及设置sudo
创建admin
# 创建uid为1000的admin组
# 物理主机安装可以跳过,因为installer有一个交互步骤完成了这个工作
pw groupadd admin -g 501
# 创建admin用户
# 物理主机安装可以跳过,因为installer有一个交互步骤完成了这个工作
pw useradd admin -g 501 -u 501 -d /home/admin -m -s /bin/sh
# 将admin用户加入wheel组
pw groupmod wheel -m admin
# 为admin设置密码,不过不是必须的,可以设置ssh key登录
# 物理主机安装可以跳过,因为installer有一个交互步骤完成了这个工作
passwd admin
# 修改 /usr/local/etc/sudoers 设置wheel组用户(也就是admin)无需密码sudo
# %wheel ALL=(ALL:ALL) NOPASSWD: ALL
echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /usr/local/etc/sudoers
# 设置自动启动ssh
sysrc sshd_enable="YES"
桌面程序安装
安装桌面软件
pkg install firefox keepassxc
提示
安装
keepassxc
提示:
安装
keepassxc
提示=====
Message from pcsc-lite-2.3.0,2:
--
PC/SC-Lite has been installed.
You need to install a driver for your smartcard reader e.g.,
- devel/libccid
For cardreaders connected to the serial port: After installing the driver,
please update the pcscd configuration file:
/usr/local/etc/reader.conf
For USB cardreaders add the following lines to /etc/devd.conf to enable
hotplugging:
attach 100 {
device-name "ugen[0-9]+";
action "/usr/local/sbin/pcscd -H";
};
detach 100 {
device-name "ugen[0-9]+";
action "/usr/local/sbin/pcscd -H";
};