
私のパスワードがシステム履歴に表示されないように、インストールコマンドプロンプトでパスワードを求める方法を探しています。read -s -p
インストールコマンド内でコマンドを実行する必要があると思いましたが、何もありません。運。私のステートメントが間違っているのか、どのように間違っているのか知りたいです。
mount -t cifs -o domain=domain.ad,user=thebtm,pass=$(read -s -p "password: ") "//NAS/thebtm$/" /mnt/cifsmount
password: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
答え1
マニュアルページを少し見てみると、次のことがわかります。
password=arg
specifies the CIFS password. If this option is not given then the
environment variable PASSWD is used. If the password is not
specified directly or indirectly via an argument to mount,
mount.cifs will prompt for a password, unless the guest option is
specified.
したがって、これを指定しないか、PASSWD環境変数を設定してください。
答え2
Centosにパスワードの入力を求めるには、次のパッケージをインストールします。
samba-client
cifs-utils
ルートとして実行するyum install samba-client cifs-utils
かsudo
。