Results 1 to 2 of 2

Thread: getting public keys for apt fails because of firewall

  1. #1
    Join Date
    Jan 2008
    Beans
    333

    Thumbs down getting public keys for apt fails because of firewall

    At home I add keys via this script:
    Code:
    #!/bin/bash
    
    sudo gpg --keyserver subkeys.pgp.net --recv-keys $1
    sudo gpg --armor --export $1 | sudo apt-key add -
    At work they block port 11371 so I've just been ignoring the authentication warnings when I use apt but this bothers me. Could anybody please offer suggestions for an alternate semi-automated method of adding keys when 11371 is blocked? Please and thanks!

  2. #2
    Join Date
    Aug 2009
    Beans
    5

    Re: getting public keys for apt fails because of firewall

    using an ssh tunnel and port forwarding through it helps immeasurably in those situations.

    i.e.,
    Code:
    ssh -f -L 11371:KEY_SERVER_NAME:11371 SSH_HOST_NAME -N
    using this method, you would connect to localhost instead of the normal hostname. to use the hostname you posted as an example:

    Code:
    #!/bin/bash
    
    KEYHOST=localhost
    
    sudo gpg --keyserver $KEYHOST --recv-keys $1
    sudo gpg --armor --export $1 | sudo apt-key add -
    ssh is a lifesaver in the land of corporates, so long as you have the ability to get out on port 22 at least.
    Last edited by sgerrand; August 8th, 2009 at 12:18 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •