Skip to content

Commit c46f5fa

Browse files
ymodlinclaude
andcommitted
Add Claude Code permissions with sshpass read-only rules
Allow read-only remote commands via sshpass (cat, ls, find, grep, dtc, dpkg, nvidia-smi, etc.) while denying destructive operations (rm -rf, mkfs, reboot, shutdown, dd). Also includes standard local tool permissions for git, build system, deployment, and common CLI utilities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6b0383c commit c46f5fa

1 file changed

Lines changed: 134 additions & 0 deletions

File tree

.claude/settings.json

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Read",
5+
"Glob",
6+
"Grep",
7+
"Edit",
8+
"Write",
9+
"NotebookEdit",
10+
"WebFetch",
11+
"WebSearch",
12+
13+
"Bash(git status*)",
14+
"Bash(git diff*)",
15+
"Bash(git log*)",
16+
"Bash(git show*)",
17+
"Bash(git branch*)",
18+
"Bash(git fetch*)",
19+
"Bash(git rebase*)",
20+
"Bash(git apply*)",
21+
"Bash(git worktree*)",
22+
"Bash(git show-branch*)",
23+
"Bash(git tag*)",
24+
"Bash(git stash*)",
25+
"Bash(git checkout*)",
26+
"Bash(git add*)",
27+
"Bash(git commit*)",
28+
"Bash(git rev-parse*)",
29+
"Bash(git merge-base*)",
30+
"Bash(gh *)",
31+
32+
"Bash(./setup_workspace.sh*)",
33+
"Bash(./apply_patches.sh*)",
34+
"Bash(./build_all.sh*)",
35+
"Bash(make *)",
36+
37+
"Bash(./scripts/deploy_kernel*)",
38+
"Bash(ssh *)",
39+
"Bash(scp *)",
40+
41+
"Bash(sshpass *cat *)",
42+
"Bash(sshpass *ls *)",
43+
"Bash(sshpass *find *)",
44+
"Bash(sshpass *grep *)",
45+
"Bash(sshpass *head *)",
46+
"Bash(sshpass *tail *)",
47+
"Bash(sshpass *wc *)",
48+
"Bash(sshpass *file *)",
49+
"Bash(sshpass *stat *)",
50+
"Bash(sshpass *md5sum *)",
51+
"Bash(sshpass *xxd *)",
52+
"Bash(sshpass *diff *)",
53+
"Bash(sshpass *strings *)",
54+
"Bash(sshpass *echo *)",
55+
"Bash(sshpass *test *)",
56+
"Bash(sshpass *which *)",
57+
"Bash(sshpass *uname*)",
58+
"Bash(sshpass *hostname*)",
59+
"Bash(sshpass *df *)",
60+
"Bash(sshpass *du *)",
61+
"Bash(sshpass *lsblk*)",
62+
"Bash(sshpass *blkid*)",
63+
"Bash(sshpass *mount*)",
64+
"Bash(sshpass *lsmod*)",
65+
"Bash(sshpass *dmesg*)",
66+
"Bash(sshpass *ip *)",
67+
"Bash(sshpass *free*)",
68+
"Bash(sshpass *uptime*)",
69+
"Bash(sshpass *whoami*)",
70+
"Bash(sshpass *id *)",
71+
"Bash(sshpass *ps *)",
72+
"Bash(sshpass *dpkg *)",
73+
"Bash(sshpass *nvidia-smi*)",
74+
"Bash(sshpass *nvcc *)",
75+
"Bash(sshpass *dtc *)",
76+
"Bash(sshpass *modinfo *)",
77+
"Bash(sshpass *efibootmgr*)",
78+
"Bash(sshpass *nv_update_engine --help*)",
79+
"Bash(sshpass *nv_bootloader_payload_updater --help*)",
80+
"Bash(sshpass *nv_bootloader_payload_updater --print*)",
81+
"Bash(sshpass *parted*print*)",
82+
83+
"Bash(python3 *)",
84+
"Bash(pytest *)",
85+
"Bash(python3 test/*)",
86+
87+
"Bash(cppcheck *)",
88+
89+
"Bash(ls *)",
90+
"Bash(find *)",
91+
"Bash(grep *)",
92+
"Bash(cat *)",
93+
"Bash(head *)",
94+
"Bash(tail *)",
95+
"Bash(wc *)",
96+
"Bash(diff *)",
97+
"Bash(file *)",
98+
"Bash(realpath *)",
99+
"Bash(nproc*)",
100+
"Bash(which *)",
101+
"Bash(tee *)",
102+
"Bash(mkdir *)",
103+
"Bash(cp *)",
104+
"Bash(mv *)",
105+
"Bash(ln *)",
106+
"Bash(tar *)",
107+
"Bash(wget *)",
108+
"Bash(curl *)",
109+
110+
"Bash(v4l2-ctl *)",
111+
"Bash(media-ctl *)",
112+
"Bash(lsmod*)",
113+
"Bash(dmesg*)",
114+
"Bash(sudo dmesg*)",
115+
"Bash(uname *)"
116+
],
117+
"deny": [
118+
"Bash(git push --force*)",
119+
"Bash(git reset --hard*)",
120+
"Bash(git clean -f*)",
121+
"Bash(rm -rf /*)",
122+
123+
"Bash(sshpass *rm -rf*)",
124+
"Bash(sshpass *rm -r *)",
125+
"Bash(sshpass *mkfs*)",
126+
"Bash(sshpass *dd if=*)",
127+
"Bash(sshpass *reboot*)",
128+
"Bash(sshpass *shutdown*)",
129+
"Bash(sshpass *poweroff*)",
130+
"Bash(sshpass *halt*)",
131+
"Bash(sshpass *flash*)"
132+
]
133+
}
134+
}

0 commit comments

Comments
 (0)