Skip to content

Commit 8224127

Browse files
committed
Linux/wsl2 caikeng
1 parent f3da58a commit 8224127

8 files changed

+39
-9
lines changed

source/2024-07-14-blog-example.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title:
33
date: 2024-07-14 15:12:00
44
tags: [tat1, tag2]
5-
categories: [category1, category2]
5+
categories: category
66
---
77

88
# 这是简单的博客模板,文件名称不要带空格,否则会出错
@@ -14,8 +14,8 @@ categories: [category1, category2]
1414
- 文件内容:
1515
- 标题:`# 这是简单的博客模板,文件名称不要带空格,否则会出错`
1616
- 日期:`date: 2024-07-14 15:12:00`
17-
- 标签:`tags: [tat1, tag2]`
18-
- 分类:`categories: [category1, category2]`
17+
- 标签:`tags: [tat1, tag2] 一篇文章可以有多个标签`
18+
- 分类:`categories: 一篇文章只能有一个分类`
1919

2020
## 博客使用中文名称说明
2121
- 文件名用英文命名, 博客里 `title` 用中文名称, 不会影响博客链接
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: 修改 WSL 默认用户为 root
3+
data: 2025-03-07
4+
categories: Linux
5+
tags: [wsl2, 踩坑]
6+
---
7+
前言
8+
9+
> 这是在我学习 `Redis` 的过程中遇到的问题
10+
11+
因为在学习过程不能每一次手动重启 `Redis` 所以需要修改 **Redis.conf** 文件。
12+
13+
然后就发现想从 Windows 文件资源管理器打开 WSL 文件的时候爆了 **没有权限** 的问题。
14+
15+
解决方法如下:
16+
## 修改 WSL 默认用户为 root
17+
修改默认用户: 在 Windows 终端中执行以下命令,将默认用户改为 root:
18+
```cmd
19+
C:\Users\你的用户名\AppData\Local\Microsoft\WindowsApps\发行版名称.exe config --default-user root
20+
```
21+
例如,对于 Ubuntu 24.04,命令为:
22+
```cmd
23+
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\ubuntu2404.exe config --default-user root
24+
```
25+
重启 WSL: 修改完成后,重启 WSL:
26+
```bash
27+
wsl --shutdown
28+
wsl
29+
```
30+
这样,通过 \\\wsl$ 访问文件时将以 root 用户身份操作,避免权限不足的问题

source/_posts/实用工具/2024-07-02-How-to-use-Git.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
title: How to use Git
44
date: 2024-07-02
55
tags: Git
6-
categories: tools
6+
categories: 实用工具
77
---
88

99
## 本地仓库上传到远端仓库(repositories)

source/_posts/实用工具/2024-09-02-try-of-Dvorak.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Dvorak键盘布局体验
33
date: 2024-09-02
44
tags: 输入法
5-
categories: tools
5+
categories: 实用工具
66
---
77

88
# Dvorak键盘布局

source/_posts/实用工具/2024-09-19-write-makefile-with-me.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 和我一起写Makefile
33
date: 2024-09-19
44
tags: [Makefile]
5-
categories: tools
5+
categories: 实用工具
66
---
77

88
### Makefile执行过程

source/_posts/实用工具/2024-12-24-try-of-choco.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: windows命令行Chocolatey的使用
33
date: 2024-12-24
44
tags: chocolatey
5-
categories: tools
5+
categories: 实用工具
66
---
77

88
## Chocolatey安装和使用

source/_posts/实用工具/2024-12-25-transfer-Chinese-to-pin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Hexo自动转义文章URL为拼音
33
date: 2024-12-25
44
tags: hexo
5-
categories: tools
5+
categories: 实用工具
66
---
77

88
## 使用场景

source/_posts/实用工具/2025-02-13-三种-commit-操作.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: commit 操作
33
date: 2025-02-13
44
tags: Git
5-
categories: tools
5+
categories: 实用工具
66
---
77

88
### 一、Undo Commit

0 commit comments

Comments
 (0)