Test SSH Tunnel iOS application with custom Open SSH configuration.
User: root Password: my_password Port: 2222
- Build & Run container with:
docker-compose up
. - Configure connection in SSH Tunnel application using Docker host IP address, it must be available from an iOS device.
Port: 5555
- Replace
key.pub
with your public key. - Build & Run container with:
docker-compose up
. - Test SSH connection:
ssh root@localhost -p 2222 -i ~/.ssh/key
, where~/.ssh/key
- path to a private key file. - Configure connection in SSH Tunnel application using private key. (use
ssh-keygen -t rsa
to create a keypair)
User: root Password: my_password Port: 3333
- Attach to container:
docker exec -it ssh_tunnel_pam_ga /bin/bash
- Configure PAM (Google Authenticator) by running
google-authenticator
- Connect
ssh root@localhost -p 3333
User: root Password: my_password Port: 4444
- Attach to container:
docker exec -it ssh_tunnel_linux_pam_yubikey /bin/bash
- Configure PAM (Yubikey OTP)
2.1. Install the Yubico pam library.2.2. Generate an API key from Yubico using this form.sudo add-apt-repository ppa:yubico/stable sudo apt-get update sudo apt-get install libpam-yubico
2.3. Update your pam settings to use YubiKeys.2.4. Editsudo nano /etc/pam.d/sshd # As the first line in the file, include the following: auth required pam_yubico.so id=[Your Client ID] key=[Your Secret Key] debug authfile=/etc/yubikey_mappings mode=client # Also, comment out this line: @include common-auth
/etc/yubikey_mappings
file and populate it with the first 12 characters of your YubiKey's OTP and username.2.5. Update your sshd_config to authenticate via publickey and PAM.# Example: rachel:gd3rk2osn5hs
2.6 Restart service.sudo nano /etc/ssh/sshd_config # Add/Update lines: ChallengeResponseAuthentication yes AuthenticationMethods password,keyboard-interactive:pam UsePAM yes
sudo service sshd restart
- Connect
ssh root@localhost -p 4444