How to handle scp connection with custom command

ryan at islandzero.net ryan at islandzero.net
Sat Aug 26 17:51:34 AEST 2017


Hi, everyone

I’m developing an internal bastion system for my company.

It synchronize ssh public keys to ‘~/.ssh/authorized_keys’ and set ‘COMMAND’ option to attach different Docker container for different user.

Basically something like this:

restrict,pty,command=“/usr/bin/docker exec -ti bunker-1-ryan /bin/bash" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQg401lnhl+hNzFpESjN+XvBkR/swIaHYP1no8lmcUJB25OF5ZP6vAN4Nh2EqULqUQ8tSpuFzistO+SwIn10OM8bzAy/OEWoHQUcjvJ1aS4kyZi9HKmfj66K7Mnm78Q7uc1jiDAzn0aZkQzR7hVj0jSXRXD68Q7el3DllgunyfsQs4yXroAFHO6g+mcO8jd71jZx0nB3dpnSlqJuFGl5nJlWoSaw6aTrW0wYdVk/YqpQtYGOGS/lzLvUj0eMIIYZ2w3L+ZVSFPcWkgf80TPVvQD6kmlWcbStR4xNW2dmL09WlYH+SLPu4BCvvPU0vCO83Y+u2qSqBTRKA/S0Xm0Nx1 ryan at islandzero.net

But the problem is ‘scp' does not work, I wonder how to handle ‘scp' requests with custom COMMAND option.

Thanks.

Yanke Guo (Ryan)
ryan at islandzero.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20170826/91f02a4a/attachment.asc>


More information about the openssh-unix-dev mailing list