我正在尝试直接通过 SSH 打开 LUKS 驱动器。
ssh root@XX "cryptsetup luksOpen /dev/sdb3 secure
但是,没有密码提示,它卡住了。
debug1: Sending command: cryptsetup luksOpen /dev/sdb3 secure
debug2: channel 1: request exec confirm 1
debug2: callback done
debug2: channel 1: open confirm rwindow 0 rmax 32768
debug2: channel 1: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 1
debug2: exec request accepted on channel 1
Run Code Online (Sandbox Code Playgroud)
这是不可能的事情吗?
要使提示起作用,您需要添加-t
.
ssh -t root@host cryptsetup luksOpen /dev/thing luksthing
Run Code Online (Sandbox Code Playgroud)
(如果您只是在“卡住”等待输入时输入密码,它也可以工作,但它会在您的本地终端中回显。)
或者,管道密码可以很好地工作:
echo -n 'password' | ssh root@host cryptsetup luksOpen /dev/thing luksthing
Run Code Online (Sandbox Code Playgroud)
并且为了防止它泄漏到进程列表和命令历史记录中,最好将其放在一个文件中。
ssh root@host cryptsetup luksOpen /dev/thing luksthing < passwordfile
Run Code Online (Sandbox Code Playgroud)
在这一点上,您最好使用真正随机的密钥文件,而不仅仅是一个简单的密码。
归档时间: |
|
查看次数: |
517 次 |
最近记录: |