How to ssh into the machines

1,133 views
Skip to first unread message

jit...@seas.upenn.edu

unread,
Nov 12, 2015, 3:43:26 PM11/12/15
to cloudlab-users
Hi,

I am trying to ssh from one node to another in the same profile (testBed1) that I have created but I am not able to do so using my Cloudlab credentials.
Can anyone help me out with this? Thanks!

Leigh Stoller

unread,
Nov 12, 2015, 4:06:53 PM11/12/15
to jit...@seas.upenn.edu, cloudlab-users
> I am trying to ssh from one node to another in the same profile
> (testBed1) that I have created but I am not able to do so using my
> Cloudlab credentials.

Hi. In order to ssh between nodes, you need to add at least one of your own
ssh public keys to Cloudlab, and then typically run an ssh agent (to handle
forwarding). You can add your ssh pub keys by clicking on the Actions menu
and selecting "Manage SSH Keys".

Leigh





Robert Ricci

unread,
Nov 12, 2015, 4:17:55 PM11/12/15
to Leigh Stoller, jit...@seas.upenn.edu, cloudlab-users
We also have some recipes that you can use to set up passwordless ssh between the nodes in your experiment using an experiment wide key. We don’t set this up by default due to security concerns, but we can send along the recipes if you are interested.
> --
> You received this message because you are subscribed to the Google Groups "cloudlab-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cloudlab-user...@googlegroups.com.
> To post to this group, send email to cloudla...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cloudlab-users/D75E8F31-4D28-472F-A730-B512C5E63A76%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

jit...@seas.upenn.edu

unread,
Nov 12, 2015, 10:11:03 PM11/12/15
to cloudlab-users, lbst...@gmail.com, jit...@seas.upenn.edu

It would be great if you can send those recipes. Thanks!

Gary Wong

unread,
Nov 13, 2015, 11:41:49 AM11/13/15
to jit...@seas.upenn.edu, cloudlab-users, lbst...@gmail.com
On Thu, Nov 12, 2015 at 07:11:02PM -0800, jit...@seas.upenn.edu wrote:
> On Thursday, November 12, 2015 at 4:17:55 PM UTC-5, Robert Ricci wrote:
> > We also have some recipes that you can use to set up passwordless ssh
> > between the nodes in your experiment using an experiment wide key.
>
> It would be great if you can send those recipes. Thanks!

Hi! The exact procedure for invocation will vary depending how your
profile is constructed (whether it uses geni-lib, a raw RSpec, Jacks,
or Chef), but you can use this shell script to install a common SSH
key pair for any user on any node:

------------------------------------------------------------------------
#!/bin/sh
/usr/bin/geni-get key > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 644 ~/.ssh/authorized_keys
------------------------------------------------------------------------

The key will be generated randomly as the experiment is instantiated
(so each instantiation gets a unique key), but within the experiment,
each run of the script above will create the same pair, so each account
running the script will both be able to log in to (and accept logins
from) any other account that does the same thing.

Thanks,
Gary.
--
Gary Wong g...@flux.utah.edu http://www.cs.utah.edu/~gtw/

jit...@seas.upenn.edu

unread,
Nov 22, 2015, 4:14:27 PM11/22/15
to cloudlab-users, jit...@seas.upenn.edu, lbst...@gmail.com
Thanks Gary!
Works perfectly fine.

Noah Watkins

unread,
Jun 3, 2016, 4:53:59 PM6/3/16
to cloudlab-users, jit...@seas.upenn.edu, lbst...@gmail.com
I'm trying to figure out how to add this little script to install the ssh keys into my RSpec. Would you mind posting a snippet?

Leigh Stoller

unread,
Jun 3, 2016, 5:02:29 PM6/3/16
to Noah Watkins, cloudlab-users, jit...@seas.upenn.edu
> I'm trying to figure out how to add this little script to install the ssh
> keys into my RSpec. Would you mind posting a snippet?

Hi. Take a look at this:
http://www.protogeni.net/wiki/ProtoGeni/wiki/RSpecRequestTarballExample

You will want to put that script snippet into a file in a tarfile, rather
then try to figure out how to do it in one line. :-)

Leigh

Noah Watkins

unread,
Jun 10, 2016, 7:37:27 PM6/10/16
to cloudlab-users, noahw...@gmail.com, jit...@seas.upenn.edu
I was able to get this script working, but it setup the keys for the root ssh user. I switched the script to hard code my user and it didn't setup the keys, suggesting that the script is run before user accounts are mounted. Is there a way to setup the keys for a non-root user when the experiment is created?

Leigh Stoller

unread,
Jun 11, 2016, 9:27:40 AM6/11/16
to Noah Watkins, cloudlab-users, jit...@seas.upenn.edu
> I was able to get this script working, but it setup the keys for the root
> ssh user. I switched the script to hard code my user and it didn't setup
> the keys, suggesting that the script is run before user accounts are
> mounted. Is there a way to setup the keys for a non-root user when the
> experiment is created?

Hi. Scripts are run after accounts are setup, so I think the best thing
to do is start up an experiment that demonstrates what you are trying to
do, and then let us know so we can take a look.

Thanks
Leigh




Reply all
Reply to author
Forward
0 new messages