Last login: Wed Nov 8 07:11:50 2023 from 115.211.241.18
FreeBSD 13.2-RELEASE-p4 GENERIC
Welcome to FreeBSD!
Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories: https://www.FreeBSD.org/security/
FreeBSD Handbook: https://www.FreeBSD.org/handbook/
FreeBSD FAQ: https://www.FreeBSD.org/faq/
Questions List: https://www.FreeBSD.org/lists/questions/
FreeBSD Forums: https://forums.FreeBSD.org/
Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with: pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.
Show the version of FreeBSD installed: freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages: man man
FreeBSD directory layout: man hier
To change this login announcement, see motd(5).
To set a custom ZFS property on the mypool pool, you need to provide it
using the "key1:key2=value" syntax, where the colon (:) is used as the
separator and identifier from the built-in ZFS properties:
# zfs set warranty:expires=2038-01-19 mypool
The custom property is applied to all datasets and can be queried like any
built-in properties using zfs get:
zfs get warranty:expires mypool
To reset the value of a custom property, use the inherit subcommand:
# zfs inherit warranty:expires mypool
Removing a custom property from a pool is done using the -r flag to the
"zfs inherit" command:
# zfs inherit -r warranty:expires mypool
-- Benedict Reuschling <[email protected]>
ec2-user@freebsd:~ $ su
root@freebsd:/home/ec2-user #
新建用户
使用 adduser 命令新建一个用户:
root@freebsd:/home/ec2-user # adduser
Username: pengjiayou
Full name: Charles Peng
Uid (Leave empty for default):
Login group [pengjiayou]:
Login group is pengjiayou. Invite pengjiayou into other groups? []: wheel
Login class [default]:
Shell (sh csh tcsh nologin) [sh]:
Home directory [/home/pengjiayou]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]: yes
Use an empty password? (yes/no) [no]: no
Use a random password? (yes/no) [no]: no
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username : pengjiayou
Password : *****
Full Name : Charles Peng
Uid : 1004
Class :
Groups : pengjiayou wheel
Home : /home/pengjiayou
Home Mode :
Shell : /bin/sh
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (pengjiayou) to the user database.
Add another user? (yes/no): no
Goodbye!
查一下,新建的用户加入了 wheel 组
root@freebsd:/home/ec2-user # id pengjiayou
uid=1004(pengjiayou) gid=1004(pengjiayou) groups=1004(pengjiayou),0(wheel)
通过本地 ssh 秘钥连接服务器
在 macOS 上执行下面的命令列出本地 ssh 秘钥,复制到剪切板
cat ~/.ssh/id_rsa.pub
在 FreeBSD 13 上切换到刚刚新建的用户
su - pengjiayou
新建 .ssh 文件夹
mkdir -p ~/.ssh
使用自带的 ee 编辑器把刚刚复制的内容粘贴到 ~/.ssh/authorized_keys 文件中
root@freebsd:~ # doas
usage: doas [-nSs] [-a style] [-C config] [-u user] command [args]
编辑 /usr/local/etc/doas.conf 文件
ee /usr/local/etc/doas.conf
加入一下内容
permit nopass keepenv :pengjiayou
切换回新建的用户,然后用 doas 测试一下
root@freebsd:~ # su - pengjiayou
You can delete a range of ZFS snapshots (a-z) in multiple ways.
The following will delete d and all earlier snapshots:
zfs destroy mypool/data@%d
To delete d and all later snapshots:
zfs destroy mypool/data@d%
To delete all dataset snapshots:
zfs destroy mypool/data@%
Make sure to let ZFS perform a dry run (-n option) first and display (-v) what
it would do to confirm that the delete operation is removing exactly what you
intended.
-- Benedict Reuschling <[email protected]>
pengjiayou@freebsd:~ $ doas pkg update
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
真是后知后觉,之前只从抖音听说过 OpenEuler ,还不知道(昨天才知道)阿里云搞了一个 OpenAnolis 系统。以前去 OpenEuler 网站了解过,大概是一个基于 RHEL 的 Linux 发行版。而 Anolis OS 呢,同样是基于 RHEL ,目标是做一个 CentOS 8 在2021年底停止维护之后的替代品。
不知道为啥中国公司这么喜欢 Redhat 系的 Linux 发行版,中国联通 90% 以上的服务器都使用了 CentOS 。当然了,我最早学习 Linux 也是从 Fedora 开始的,但最近很多年无论是 Linux 桌面还是服务器上我都更喜欢 Debian 系,主要是 Ubuntu 啦。
全球开源发展20余年,以前中国就没有一个 Linux 的上游社区,现在随着国产 CPU 的崛起,本土创新开源操作系统平台应运而生。OpenAnolis 除了支持 x86 和 amd64 这两种常见架构之外,还支持飞腾、海光、兆芯、鲲鹏,龙芯等国产芯片。
据公开信息统计,华为对 Linux 贡献了13762条代码,目前已经超过Ubuntu和其母公司Canonical的总贡献数,阿里则是1105条。这两家公司的开源系统,一个叫“欧拉”,一个叫“龙蜥”。如果还说人家是换皮,多少有点不合适了吧,真“国产”无疑啊,不仅为国内数字基础设施提供操作系统,还为国际开源软件贡献力量!
[root@iZbp14664y88ufuyrhsokhZ ~]# sudo dnf config-manager --set-enabled Plus
[root@iZbp14664y88ufuyrhsokhZ ~]# sudo dnf update
AnolisOS-8.2 - Plus 24 MB/s | 4.9 MB 00:00
Last metadata expiration check: 0:00:01 ago on Mon 25 Oct 2021 01:29:07 AM CST.
Dependencies resolved.
Nothing to do.
Complete!
[root@iZbp14664y88ufuyrhsokhZ ~]# dnf search tengine
Last metadata expiration check: 0:00:11 ago on Mon 25 Oct 2021 01:29:07 AM CST.
==================================================== Name Exactly Matched: tengine ====================================================
tengine.x86_64 : A distribution of Nginx with some advanced features