bin sh mkdir -m 755 pts ln -sf proc self fd fd ln -sf fd stderr ln -sf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/bin/sh
mkdir -m 755 pts
ln -sf ../proc/self/fd fd
ln -sf fd/2 stderr
ln -sf fd/0 stdin
ln -sf fd/1 stdout
mknod -m 666 null c 1 3
mknod -m 666 zero c 1 5
mknod -m 666 full c 1 7
mknod -m 644 random c 1 8
mknod -m 644 urandom c 1 9
mknod -m 666 tty c 5 0
mknod -m 666 ptmx c 5 2