Password Protection of GRUB Menu

By default, the boot loader interface is accessible to anyone with physical access to the console: anyone can select and edit any menu entry, and anyone can get direct access to a GRUB shell prompt. For most systems, this is reasonable since anyone with direct physical access has a variety of other ways to gain full access, and requiring authentication at the boot loader level would only serve to make it difficult to recover broken systems.

However, in some environments, such as kiosks, it may be appropriate to lock down the boot loader to require authentication before performing certain operations.

  • Set GRUB Passwords
  • Enable More Authentication Support

Read More

reset root pw

rpm-based Distros(RedHat,CentOS,Fedora)
deb-baesd Distros(Debian,Ubuntu,Mint)
If you enter “passwd”or”vi”or”vim”,then may show “command not found”. because /usr isn’t mount.
If you /usr is in LVM, you can’t mount it because lvm is in /usr not in kernel. You need use nano,which is included in initramfs.

Read More

esc-seq and tput (1)--colors

Use Escape Sequence To Set Colors
Nowadays terminal like XTerm & URxvt support 256color. But only the first 16 can be specified using resources currently or other configuration file, the rest can only be shown via command sequences (“escape codes”).
The ECMA-48 SGR sequence ( ESC [ parameters m ) can set foreground & background colors.
Use ‘tput’ To Set Colors
It is generally not good practice to hard-wire terminal controls into programs. Linux supports a terminfo(5) database of terminal capabilities. Rather than emitting console escape sequences by hand, you will almost always want to use a terminfo-aware screen library or utility such as tput(1).
tput command can initialize a terminal or query terminfo database,and could be used in shell conveniently.
Use Escape Sequence to Set Display Attributes
Apart from display foreground & background,the ECMA-48 SGR sequence ( ESC [ parameters m ) can set display attributes.
Use ‘tput’ to Set Display Attributes
Extensive Reading: about setaf/setab & setf/setb
From man terminfo
section Color Handling

Read More

Arch Linux Installation Record

  • Temporary Configuration 临时设置
  • Net-link & Source Configuration 联网&设置软件源
  • Create Partition 分区
  • MKFS 创建文件系统
  • MOUNT 挂载目标分区
  • BASE Installation 安装基础系统
  • Base Configuration 配置基础系统
  • Boot Configuration 启动引导配置
  • Xorg & GPU Driver
  • Input Method:fcitx/ibus/rime
  • CLI Program
  • GUI Program
  • More Configuration

    Read More