Avatar

Organizations

2 results for Bash
  • Alpine Linux 原始安装的是 busybox,小巧精干,但毕竟与主流的 Bash 还是有区别,特别是与其它系统联动时会比较麻烦,所以还是安装 Bash,统一 Shell 环境,方便日后使用。

    而且基本网上的安装教程都有问题,所以这里给出正确的安装步骤。

    安装

    $ apk add bash libuser
    

    配置

    $ touch /etc/login.defs
    $ mkdir /etc/default
    $ touch /etc/default/useradd
    $ lchsh <root>
    Changing shell for root.
    Password: <root password>
    New Shell [/bin/ash]: /bin/bash
    Shell changed.
    

    参考文档:

    linux bash alpine linux Created Tue, 03 Jan 2023 20:08:42 +0800
  • 初始化配置

    1.软件更新

    软件库管理

    2. 配置时间

    # debian
    apt install -y systemd-timesyncd
    # almalinux
    # systemd 是默认安装且无法卸载的核心基础包
    
    # 设置时区
    timedatectl set-timezone Asia/Shanghai
    # 启动NTP服务
    timedatectl set-ntp true
    
    ; debian
    ; /etc/systemd/timesyncd.conf
    [Time]
    NTP=ntp.ntsc.ac.cn
    FallbackNTP=ntp.aliyun.com ntp.tencent.com 0.cn.pool.ntp.org
    
    # debian
    # 在LXC、Docker 或某些 VPS 环境中
    dpkg-reconfigure tzdata
    

    3. 关闭邮件服务

    systemctl stop 'postfix@*' ; systemctl disable 'postfix@\x2a' ; 
    # debian
    apt purge -y postfix
    # almalinux
    dnf remove -y postfix
    

    4. 配置网络

    4.1 配置有线

    AlmaLinux

    NetworkManager 配置网络

    CLI bash ssh top linux Created Mon, 17 Jan 2022 11:07:07 +0800