At JLab and at BNL, users must first login to one of several site firewall nodes using ssh, and then login via ssh to the desired head node (qcdochosta or qcdochostb at BNL, qcdi01 or qcdi02 at JLab). Transfering files across this firewall into either facility requires two "hops" - first, files must be scp'd to the firewall node, then scp'd from the firewall node to the target head node. A much superior alternative is to use ssh tunneling, which relies on ssh processes running on the user's node and on the firewall node to move data directly to or from the target head node. This is discussed further below.
To login to FNAL computers, or to move files to or from FNAL machines, users must employ kerberos software. First, a user must obtain a kerberos ticket. Once a ticket is held, kerberized versions of telnet, rsh, rcp, rlogin, ssh, and scp may be used to access FNAL systems. This is discussed further below.
SSH Tunneling
Both BNL and JLab rely on ssh firewalls for cyber security. The ssh utilities
include a very powerful port forwarding facility which greatly
simplifies accessing the BNL and JLab lattice QCD head nodes through these
firewalls. The ssh command syntax which is required for port forwarding is
cumbersome and very difficult to memorize. Fortunately, Steve Adler at BNL
has implemented a set of Perl scripts (tunnel.pl) which
greatly simplify port forwarding.
tunnel.pl is installed in /usr/local/bin/ on the head nodes at BNL, JLab, and FNAL. Rather than invoking tunnel.pl directly, users instead use these commands:
The tunnel.pl script relies on a configuration file which is unique to each user, $HOME/.tunnel/config. The syntax of the configuration file is explained in the BNL documentation (see the notes in "Installing the tunnel script") and in the main tunnel.pl documentation (see "How do I configure tunnel.pl?").
Here is a sample configuration file from lqcd.fnal.gov:
qcdochostb.qcdoc.bnl.gov:2002:ssh.qcdoc.bnl.gov:dholmgre:localbnl:qcdochostb
qcdi01.jlab.org:2003:jlab.org:djholm:localjlab1:qcdi01
qcdi02.jlab.org:2004:jlab.org:djholm:localjlab2:qcdi02
The fields in the configuration file, separated by colons, are as follows:
lqcd:~$ tssh qcdi02 Firing up tunnel to qcdi02.jlab.org through jlab.org using port 2004 ssh -e none -f -N -L 2004:qcdi02.jlab.org:22 djholm@jlab.org djholm@jlab.org's password: [djholm@qcdi02 ~]$
[djholm@qcdi02 ~]$ exit logout Connection to localjlab2 closed. lqcd:~$ tssh qcdi02 [djholm@qcdi02 ~]$
lqcd:~$ tssh dholmgre@qcdochostb Firing up tunnel to qcdochostb.qcdoc.bnl.gov through ssh.qcdoc.bnl.gov using port 2002 ssh -e none -f -N -L 2002:qcdochostb.qcdoc.bnl.gov:22 dholmgre@ssh.qcdoc.bnl.gov dholmgre@ssh.qcdoc.bnl.gov's password: -bash-2.05b$ hostname qcdochostb
lqcd:~$ tclose Closing tunnel on port 2004 going to qcdi02.jlab.org through jlab.org Closing tunnel on port 2002 going to qcdochostb.qcdoc.bnl.gov through ssh.qcdoc.bnl.gov lqcd:~$Notice that tclose will close all existing tunnels.
To copy a file from the local node to the target head node, use tscp:
lqcd:~$ tscp test.test qcdi02:. test.test 100% |********************************************************| 7 00:00
lqcd:~$ tscp test.test dholmgre@qcdochostb:. test.test 100% |********************************************************| 7 00:00
lqcd:~$ tscp qcdi02:test.test . test.test 100% |********************************************************| 7 00:00 lqcd:~$ tscp dholmgre@qcdochostb:test.test . test.test 100% |********************************************************| 7 00:00
lqcd:~$ tscp -r test.dir qcdi02:. file.a 100% |********************************************************| 7 00:00 file.b 100% |********************************************************| 7 00:00
qcdochostb:~$ kinit -fr 7d djholm@FNAL.GOV
Password for djholm@FNAL.GOV:
qcdochostb:~$
qcdochostb:~$ klist -f
Ticket cache: FILE:/var/krb5/security/creds/krb5cc_8386
Default principal: djholm@FNAL.GOV
Valid starting Expires Service principal
06/23/05 18:16:00 06/24/05 18:15:54 krbtgt/FNAL.GOV@FNAL.GOV
Renew until 06/30/05 18:15:54, Flags: FRIA
qcdochostb:~$
A forwardable ticket may be used, once logged into lqcd.fnal.gov, to login to another FNAL system.
Kerberos tickets are valid for 24 hours. Renewable tickets may be renewed for an additional 24 hours at any time before expiration by using
kinit -R
Note that renewing a ticket does not require you to type in your password.
The "-r 7d" switch in this example requests a ticket which may be
renewed in this manner for up to 7 days. After 7 days you have to request a
new ticket and will need to type in your password. For bash shell
users, here is a handy function which will automatically renew your tickets
every hour:
function kinit() {
env kinit -r 7d -f ${*-};
while true; do
sleep `expr 3600 \* 8`;
env kinit -R;
done &
}
If this function is included in your .bash_profile, when you use the
kinit command you will instead execute this function, which
first performs the actual kinit, and then subsequently loops
and renews the ticket every hour.
"-n" switch to
your kinit command:
qcdi01:~$ kinit -n -fr 7d djholm@FNAL.GOV
******************************************************************
*** It seems you are about to type your password over the net. ***
*** Are you SURE there's no other way to do this ? ***
*** If not, is your connection encrypted end-to-end ? ***
*** Talk with an expert or review the documentation at ***
*** http://www.fnal.gov/docs/strongauth/html/user.html ***
******************************************************************
Password for djholm@FNAL.GOV:
qcdi01:~$ klist
Ticket cache: /tmp/krb5cc_5270
Default principal: djholm@FNAL.GOV
Valid starting Expires Service principal
06/23/05 18:29:00 06/24/05 20:29:00 krbtgt/FNAL.GOV@FNAL.GOV
renew until 06/30/05 18:28:52
qcdi01:~$
Note that the JLab kinit will always issue the warning in the
box above. Be sure that your connection to JLab (or to BNL) uses only ssh, so
that all communications are encrypted.
You can renew the addressless tickets at JLab the same way as at BNL.
qcdi01:~$ fssh lqcd.fnal.gov Last login: Thu Jun 23 16:20:21 2005 from lqcdp4e2.fnal.gov lqcd:~$ qcdochostb:~$ openssh/fssh djholm@lqcd.fnal.gov Last login: Thu Jun 23 17:34:57 2005 from g865.jlab.org lqcd:~$Note that the second example above shows the syntax to use if your username at JLab or BNL is not the same as your username at FNAL.
qcdi01:~$ fscp test.test djholm@lqcd.fnal.gov:. test.test 100% |***********************************************************************************| 7 00:00 qcdi01:~$ qcdi01:~$ fscp djholm@lqcd.fnal.gov:test.test . test.test 100% |***********************************************************************************| 7 00:00