Skip to content

Commit c025ada

Browse files
authored
README update: Use umask when creating token file
The originally suggested command in the README for manually setting up the `~/.gist` token file does not ensure that the correct file permissions are set on the file, which may expose the token to other user accounts on the system. I'm changing to the documentation to instead suggest running `umask 0077` before creating the file to ensure that no other user accounts on the system will have access to it. In addition, by putting the entire command in parentheses, the command is executed within a subshell so that the umask is only set temporarily for the purposes of creating the file: ```sh (umask 0077 && echo MY_SECRET_TOKEN > ~/.gist) ```
1 parent 0b7f435 commit c025ada

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ token file by pasting a GitHub token with only the `gist` permission into a
106106
file called `~/.gist`. You can create one from https://github.com/settings/tokens
107107

108108
This file should contain only the token (~40 hex characters), and to make it
109-
easier to edit, can optionally have a final newline (\n or \r\n).
109+
easier to edit, can optionally have a final newline (`\n` or `\r\n`).
110110

111111
For example, one way to create this file would be to run:
112112

113-
echo MY_SECRET_TOKEN > ~/.gist
113+
(umask 0077 && echo MY_SECRET_TOKEN > ~/.gist)
114+
115+
The `umask` ensures that the file is only accessible from your user account.
114116

115117
### GitHub Enterprise
116118

0 commit comments

Comments
 (0)