Alpine Linux 配置

WindTerm 无法认证

WindTerm客户端,取消 “会话设置 -> SSH -> 验证 -> 尝试键盘交互认证” 可已正常连接。

安装 OpenSSH Server

1$ apk update
2$ apk add openssh-server openssh
 1; /etc/ssh/sshd_config
 2
 3# 开放Root登录
 4- #PermitRootLogin prohibit-password
 5+ PermitRootLogin yes
 6
 7# 允许其它用户登录
 8- #PasswordAuthentication yes
 9+ PasswordAuthentication yes
10
11# 解决ssh自动断开
12- #ClientAliveInterval 0
13- #ClientAliveCountMax 3
14+ ClientAliveInterval 60
15+ ClientAliveCountMax 3
1$ rc-service sshd start
2
3$ rc-service sshd restart
4# 设置开机启动
5$ rc-update add sshd
6# 删除开机启动服务
7$ rc-update del sshd
8# 显示所有服务
9# rc-status -a

终端配置

在 /etc/profile.d 文件夹下,创建sh文件来实现。

1# /etc/profile.d/30user.sh
2+ alias ll='ls -la --color=tty'
3# Alpine Linux BusyBox 不支持日期格式
4# [HH:MM] path
5# [user@hostname] 命令提示符
6+ export PS1='\[\e[36;40m\][\A] \[\e[0m\] \[\e[35;40m\]\w\[\e[0m\]\n\[\e[33;40m\][\u@\H]\[\e[0m\] \\$ '
7# keychain
8+ eval `keychain --eval ~/.ssh/github.com`

修改时区

1# 查看当时时间
2$ date -R
3# 修改到 +8 时区
4$ apk add tzdata
5$ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
6$ echo "Asia/Shanghai" > /etc/timezone
7$ apk del tzdata

修改主机名

1; /etc/hostname
2<hostname>
1$ reboot

相关专栏文章