Closed nemo701 closed 1 month ago
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
We have no plans to add SSH to our containers. We would assume if you're already deploying the container on the server that you'd have SSH access to said server. If you really must add SSH, you can manually add it via https://github.com/linuxserver/docker-mods/tree/universal-package-install and configure it yourself.
Fair enough. Thank you for responding so quickly :)
In case it's useful to anyone else, I think I've got this working by -
DOCKER_MODS=linuxserver/mods:universal-package-install
and INSTALL_PACKAGES=openssh
)ssh-keygen -A
within the container/etc/ssh/sshd_config
to add PermitRootLogin yes
passwd
to set the root passwordI can now connect to the container over ssh, but need to pass some environmental variables to the ssh session, which I do as follows -
bla="BEETSDIR=/config"
bla2="HOME=/config"
bla3="VIRTUAL_ENV=/lsiopy"
bla4="PATH=/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin://usr/bin:/sbin:/bin"
bla5="_=/usr/bin/env"
bla6="EDITOR=nano"
ssh -t root@192.168.1.16 -p 8338 "export $bla $bla2 $bla3 $bla4 $bla5 $bla6 && /bin/bash"
(substitute 8338 for whichever port you've mapped to port 22 on the container)
It feels a bit hacky, and I'm not certain that all of the exported variables are necessary (or if I've missed any), so feel free to suggest improvements. I just wanted to put this here in case it helps :)
Is this a new feature request?
Wanted change
Given that beets is a command line program, would it be possible to add direct shell access to the docker container?
Reason for change
The docs says that you can connect to the docker container using
docker exec -it -u abc beets bash
, but that supposes you are running the container from the same machine that you are using when you want to run beets. Adding ssh access would allow you to run the container (and store its data) on a separate machine (eg on a home server).I realise that you can ssh into the home server and then run the
docker exec
command from there, but it would be nice if there was an option to eliminate the extra step.Proposed code change
Perhaps have additional environmental variables (SSH_USER, SSH_PASS) which, if set, enable sshd with those login details?
I've tried to add sshd to the container via custom-services.d and custom-cont-init.d, and while this works as far as allowing me to connect to the container, the
beet
command isn't available (it looks like the user who has connected via ssh is missing /lsiopy/bin from PATH - but if I add that manually to the PATH,beet config -e
doesn't work ("error: Could not edit configuration: [Errno 2] No such file or directory"), so it feels like I'm missing something... assuming this is even a valid route to achieve what I'm looking for :) )