
我已經安裝了 sshfs 並且知道如何安裝驅動器,但是當我嘗試自動提供密碼時它沒有做任何不同的事情。
eric@MAVERICK:~$ sshfs [email protected]:/home/ericfoss/Downloads Downloads/folder/ < pass.txt
[email protected]'s password:
eric@MAVERICK:~$
有想法嗎?
答案1
你應該調查一下基於公鑰的 SSH 驗證這樣您就不需要提供密碼來登入 192.168.0.200 機器。
基本上,您可以在 MAVERICK 機器上以“eric”身份運行,然後將創建的文件ssh-keygen
內容複製到~.ssh/id_rsa.pub
/home/ericfoss/.ssh/authorized_keys
在 192.168.0.200 機器上。
答案2
嘗試在您提供的文件 (pass.txt) 中的實際密碼後面新增換行符 (\n)。
如果您在命令列上鍵入它,您也可以提供您看到的換行符。