Setting up SSH on the system simulator

From Cellbe

Revision as of 16:04, 19 September 2012 by 91.201.64.7 (Talk)

reldomacc This article explains how to setup ssh your host and your simulated environment. At the end, you will be able to run ssh to connect to your host from the simulated environment, and viceversa. This information can be (partially) found on the IBM system simulator user guide (on a default sdk installation, this can be found on /opt/ibm/systemsim-cell/doc/SystemSim.Users.guide)

The following conventions will be used:

  • $ your user bash prompt in the host environment
  • # your root bash prompt in the host environment
  • [root@(none) ~]# The bash prompt in the simulated environment
  • % The TCL simulator shell.

fSCQ2E Thanks a lot for the article. Awesome.

Really appreciate you sharing this post.Thanks Again. Will read on...

7vkyuR I loved your blog.Really thank you! Much obliged.

Setting up the simulated environment

Now the dirty hack: to make sshd start on boot, edit root's .bashrc on the simulated environment:

[root@(none) ~]# vi .bashrc

and at the end of the file add this line:

/etc/init.d/sshd start

then save and exit, and source your .bashrc:

[root@(none) ~]# source .bashrc

This surely is a dirty way to make it start sshd on boot, but we didn't find a better way (chkconfig sshd on did not work). Now you should be able to ssh to the simulated environment, running

$ ssh root@172.20.0.2

at the bash prompt on your host. But there's a problem: in the simulated environment changing the password with passwd gave an error message. We solved it appending our public keys in the simulated environment: At your host prompt, generate your public keys:

$ ssh-keygen -t rsa

Now, from the simulated environment, copy your key file, and then append it to your authorized_keys file.

[root@(none) ~]# scp user@host:~/.ssh/id_rsa.pub .
[root@(none) ~]# cat id_rsa.pub >> ~/.ssh/authorized_keys

Substitute user with your user name on the host of course, and do this for each user you want to have access on your simulated machine. To make this changes persistent, sync your simulated disk: press Ctrl-c in the simulator tcl shell window to obtain the prompt, and then type:

% mysim bogus disk sync 0

You can resume the simulator typing

% mysim go

Now, ssh should work: at your host prompt, type

$ ssh root@172.20.0.2

If everything went well, it should ask you no password, and take you to the simulator prompt.

laynor 07:40, 4 July 2007 (EDT)

Personal tools