Skip to content

Commit 25ce109

Browse files
authored
Update ubuntu初始化.md
1 parent a597b01 commit 25ce109

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

linux/ubuntu/ubuntu初始化.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,19 @@ ls -l /home/
8181
#注意aws的磁盘格式化,在mkfs.xfs阶段会有点慢,需要手动执行下,然后执行mount -a重新挂载下
8282
```
8383

84-
# 、修改主机名
84+
# 、修改主机名
8585

8686
```
8787
https://www.cnblogs.com/zeusmyth/p/6231350.html
8888
89-
vim /etc/hostname
89+
cat > /etc/hostname << EOF
90+
hk-ubuntu-188
91+
EOF
92+
hostname hk-ubuntu-188
9093
```
9194

9295

93-
# 、脚本
96+
# 、脚本
9497
```
9598
sudo apt update -y
9699
sudo apt upgrade -y
@@ -120,7 +123,7 @@ vim /etc/profile
120123
export PS1="\[\e]0;\a\]\n\[\e[1;32m\]\[\e[1;33m\]\H\[\e[1;35m\]<\$(date +\"%Y-%m-%d %T\")> \[\e[32m\]\w\[\e[0m\]\n\u>\\$ "
121124
```
122125

123-
# 、sshd配置
126+
# 、sshd配置
124127
```
125128
cat > /etc/ssh/sshd_config << \EOF
126129
Port 33389
@@ -159,7 +162,7 @@ EOF
159162
systemctl restart sshd
160163
```
161164

162-
# 、防火墙配置
165+
# 、防火墙配置
163166
```
164167
sudo apt-get install -y ufw
165168
sudo ufw reset

0 commit comments

Comments
 (0)