@@ -232,7 +232,23 @@ These features are useful once you're comfortable.
232232
233233Use SSHFS to mount your Sprite and edit files with your local tools.
234234
235- ** Install SSHFS first:**
235+ ** Install and configure OpenSSH on the Sprite:**
236+
237+ ``` bash
238+ sudo apt install -y openssh-server
239+
240+ # Create a service to automatically start sshd
241+ sprite-env services create sshd --cmd /usr/sbin/sshd
242+ ```
243+
244+ ** Authorize your SSH public key:**
245+
246+ ``` bash
247+ sprite exec mkdir -p " .ssh"
248+ sprite exec sh -c " cat > .ssh/authorized_keys" < ~ /.ssh/id_ed25519.pub
249+ ```
250+
251+ ** Install SSHFS on your host:**
236252
237253``` bash
238254# macOS
@@ -250,11 +266,13 @@ sudo dnf install fuse-sshfs
250266``` bash
251267# Add to ~/.zshrc or ~/.bashrc
252268sc () {
253- local sprite_name=" ${1 :- $(sprite use)} "
269+ local sprite_name=" $1 "
254270 local mount_point=" /tmp/sprite-${sprite_name} "
271+ test -n " $( sprite url -s " ${sprite_name} " ) "
255272 mkdir -p " $mount_point "
273+ sprite proxy -s " ${sprite_name} " 2000:22 &
256274 sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 \
257- " sprite@${sprite_name} .sprites.dev: " " $mount_point "
275+ " sprite@localhost: " -p 2000 " $mount_point "
258276 cd " $mount_point "
259277}
260278```
@@ -263,6 +281,7 @@ sc() {
263281
264282``` bash
265283umount /tmp/sprite-my-sprite
284+ kill " $( lsof -t -i:2000) "
266285# macOS may need: diskutil umount /tmp/sprite-my-sprite
267286```
268287
0 commit comments