制限付きユーザー(rbash)を許可し、virshを実行します。

制限付きユーザー(rbash)を許可し、virshを実行します。

時にはリモートで再起動する必要がある仮想win7システムがあります。制限されたユーザーアカウントを作成し、ユーザーがvirshを介してログインし、必要に応じて仮想マシンを再起動できるようにシェルをrbashに設定しました。

user@machine:~$ echo $SHELL
/bin/rbash
user@machine:~$ virsh
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # list
error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

virshとvirt-topは実行されますが、ユーザーはvirsh内で何もできません。このユーザーがrbashシェルでvirshコマンドを実行できるようにするにはどうすればよいですか?

ベストアンサー1

Andreasは正しいです。これはrbashの問題ではありません。ユーザーを libvirtd グループに追加すると、問題が解決します。

おすすめ記事