Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #474: allow vagrant localhost ssh in vm_devbox #475

Merged
merged 6 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rsconf/component/vm_devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pykern.pkcollections import PKDict
from pykern.pkdebug import pkdp
from rsconf import component
from rsconf import db
e-carlin marked this conversation as resolved.
Show resolved Hide resolved
from rsconf import systemd
import re

Expand Down Expand Up @@ -38,6 +39,7 @@ def _create_user_instances():
self.buildt.require_component("network")
z.run_d = systemd.unit_run_d(jc, self.name)
z.run_u = jc.rsconf_db.run_u
z.local_ip = db.LOCAL_IP
z.ssh_port = jc.vm_devbox_users.spec[self._user].ssh_port
z.ssh_guest_host_key_f = "/etc/ssh/host_key"
z.ssh_guest_identity_pub_f = "/etc/ssh/identity.pub"
Expand Down
5 changes: 5 additions & 0 deletions rsconf/package_data/vm_devbox/start.sh.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ PasswordAuthentication no
PermitRootLogin no
Protocol 2
X11Forwarding yes

# SSH acces from localhost (ex for sirepo.job_driver.sbatch)
e-carlin marked this conversation as resolved.
Show resolved Hide resolved
ListenAddress {{ this.local_ip }}:22
Match User {{ this.run_u }} Address {{ this.local_ip }}
PasswordAuthentication yes
EOF_INSTALL

echo '{{ this.ssh_identity_pub_key }}' >> '/home/{{ this.run_u }}/.ssh/authorized_keys'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ PasswordAuthentication no
PermitRootLogin no
Protocol 2
X11Forwarding yes

# SSH acces from localhost (ex for sirepo.job_driver.sbatch)
ListenAddress 127.0.0.1:22
Match User vagrant Address 127.0.0.1
PasswordAuthentication yes
EOF_INSTALL

echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKe3wWXD3GUVd/5viGVhf6L/ttJJfmksXauPSpC8zWru v9.radia.run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rsconf_service_prepare 'vm_devbox_user-1' '/etc/systemd/system/vm_devbox_user-1.
rsconf_install_access '700' 'vagrant' 'vagrant'
rsconf_install_directory '/srv/vm_devbox_user-1'
rsconf_install_access '500' 'vagrant' 'vagrant'
rsconf_install_file '/srv/vm_devbox_user-1/start' '081baa61746f4dd28339816bb90453ed'
rsconf_install_file '/srv/vm_devbox_user-1/start' '2143bff8b238bc0b4a5fdfde1da6e470'
rsconf_install_file '/srv/vm_devbox_user-1/stop' '94f5e7855deadc753f54580dfad70217'
rsconf_install_access '444' 'root' 'root'
rsconf_install_file '/etc/systemd/system/vm_devbox_user-1.service' '95beabb09a3e8a9977002d11ae4e47cd'
Expand Down
Loading