私は仮想マシンにguixをインストールしました。 sshdを実行する方法は?

私は仮想マシンにguixをインストールしました。 sshdを実行する方法は?

私は初めてguixユーザーなので、この基本的なタスクを実行するのに役立ちます。

試してみましguix pullたが、guix install openssh命令sshdは存在しません。入力guix pull後、guix install opensshopensshパッケージが作成されましたが、sshdコマンドは存在しません。読んだ後この抜粋設定を編集する必要があるようですが、この環境はguixのqemuイメージにすぎません。そして/etc/config.scm空のファイルです。だから編集することはありません。 guixでsshdサービスを起動した後、どのように実行しますか?

ベストアンサー1

だから私は多くのバイナリがguixにあり、ユーザーに隠されていることを発見しました。ここでsshdを呼び出すことはできますが、guix shell openssh外部からは見えません。

私の試み:

# This is messy and not really a guix way, but for now best I can do
sudo mkdir -p /etc/ssh
sudo tee /etc/ssh/sshd_config <<-EOF
PermitRootLogin yes
PermitEmptyPasswords yes
EOF
sudo groupadd sshd
sudo useradd -g sshd sshd
sudo ssh-keygen -A
sudo guix shell openssh -- sh -c '"$(which sshd)"'

編集:通常試してみるとどうなりますか?

guest@gnu ~$ sshd
bash: sshd: command not found
guest@gnu ~$ guix shell openssh -- sh -c sshd
sshd re-exec requires execution with an absolute path
guest@gnu ~$ guix shell openssh -- sh -c $(which sshd)
which: no sshd in (/run/setuid-programs:/home/guest/.config/guix/current/bin:/home/guest/.guix-profile/bin:/run/current-system/profile/bin:/run/current-system/profile/sbin)
sh: -c: option requires an argument
guest@gnu ~$ guix shell openssh -- sh -c "$(which sshd)"
which: no sshd in (/run/setuid-programs:/home/guest/.config/guix/current/bin:/home/guest/.guix-profile/bin:/run/current-system/profile/bin:/run/current-system/profile/sbin)
guest@gnu ~$ guix shell openssh -- sh -c '"$(which sshd)"'
/etc/ssh/sshd_config: Permission denied
guest@gnu ~$ sudo guix shell openssh -- sh -c '"$(which sshd)"'
guest@gnu ~$ 

おすすめ記事