如何在进程替换中以0600文件模式进行mkfifo

时间:2018-09-12 05:36:04

标签: bash sh

例如:

$ ssh -i <(curl -H "Authorization: Bearer ${token}" https://api.example.com/ssh-key) user@host
Permission Denied

我们可以轻松地创建一个避免使用的临时文件,但这不是效率:

$ curl -H "Authorization: Bearer ${token}" https://api.example.com/ssh-key > /tmp/ssh-key
$ chmod 0600 /tmp/ssh-key
$ ssh -i /tmp/ssh-key user@host

更好的方法是先设置umask

$ umask 077

但是我想知道有人会以更好的方式做到这一点。

0 个答案:

没有答案
相关问题