Skip to content

Commit f7fd3bf

Browse files
abendigoclaude
andcommitted
Expose SSH on port 2222 and fix key-based auth with read-only mount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2b95129 commit f7fd3bf

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
- workspace:/workspace
99
- ssh-key:/home/claude/.ssh:ro
1010
ports:
11+
- "2222:22"
1112
- "7681:7681"
1213
networks:
1314
- traefik_default

entrypoint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ set -e
44
# Generate host SSH keys if not already present
55
ssh-keygen -A
66

7+
# Copy mounted SSH keys to a writable location (mount is read-only)
8+
if [ -f /home/claude/.ssh/authorized_keys ]; then
9+
cp /home/claude/.ssh/authorized_keys /tmp/authorized_keys
10+
mkdir -p /home/claude/.ssh_writable
11+
mv /tmp/authorized_keys /home/claude/.ssh_writable/authorized_keys
12+
chmod 700 /home/claude/.ssh_writable
13+
chmod 600 /home/claude/.ssh_writable/authorized_keys
14+
chown -R claude:claude /home/claude/.ssh_writable
15+
# Point sshd to the writable copy
16+
echo "AuthorizedKeysFile /home/claude/.ssh_writable/authorized_keys" >> /etc/ssh/sshd_config
17+
fi
18+
719
# Start SSH daemon
820
/usr/sbin/sshd
921

0 commit comments

Comments
 (0)