Skip to content
Browse files

Made 05-ssh-into-vm.sh accept another argument: a user name

  • Loading branch information...
1 parent 7065702 commit 22a58379db32bb4c58bbf4e2955db44a95af6b8f @beloglazov committed
View
9 10-openstack-controller/05-ssh-into-vm.sh
@@ -17,10 +17,13 @@
# SSH into a VM instance using the generated test.pem key.
-if [ $# -ne 1 ]
+
+if [ $# -ne 2 ]
then
- echo "You must specify one arguments - the IP address of the VM instance"
+ echo "You must specify two arguments:"
+ echo "(1) the IP address of the VM instance"
+ echo "(2) the user name"
exit 1
fi
-ssh -i ../config/test.pem -l test $1
+ssh -i ../config/test.pem -l $2 $1
View
15 README.rst
@@ -2175,21 +2175,24 @@ password-less SSH connections.
(61) ``05-ssh-into-vm.sh``
This script shows how to SSH into a VM instance, which has been injected
-with the previously generated ``test`` key. The script accepts one
-argument: the IP address of the VM instance.
+with the previously generated ``test`` key. The script accepts two
+arguments: the IP address of the VM instance, and the user name. To
+connect to an instance of the Ubuntu Cloud image, the user name should
+be set to ``ubuntu``.
::
# SSH into a VM instance using the generated test.pem key.
- if [ $# -ne 1 ]
+ if [ $# -ne 2 ]
then
- echo "You must specify one arguments - \
- the IP address of the VM instance"
+ echo "You must specify two arguments:"
+ echo "(1) the IP address of the VM instance"
+ echo "(2) the user name"
exit 1
fi
- ssh -i ../config/test.pem -l test $1
+ ssh -i ../config/test.pem -l $2 $1
(62) ``06-nova-volume-create.sh``
View
BIN doc/openstack-centos-kvm-glusterfs-guide.epub
Binary file not shown.
View
11 doc/openstack-centos-kvm-glusterfs-guide.html
@@ -1464,17 +1464,18 @@ <h4 id="openstack-controller-controller.-1"><a href="#TOC"><span class="header-s
<ol start="61" style="list-style-type: example">
<li><code>05-ssh-into-vm.sh</code></li>
</ol>
-<p>This script shows how to SSH into a VM instance, which has been injected with the previously generated <code>test</code> key. The script accepts one argument: the IP address of the VM instance.</p>
+<p>This script shows how to SSH into a VM instance, which has been injected with the previously generated <code>test</code> key. The script accepts two arguments: the IP address of the VM instance, and the user name. To connect to an instance of the Ubuntu Cloud image, the user name should be set to <code>ubuntu</code>.</p>
<pre class="sourceCode Bash"><code class="sourceCode bash"><span class="co"># SSH into a VM instance using the generated test.pem key.</span>
-<span class="kw">if </span>[ <span class="ot">$#</span> -ne 1 ]
+<span class="kw">if </span>[ <span class="ot">$#</span> -ne 2 ]
<span class="kw">then</span>
- <span class="kw">echo</span> <span class="st">&quot;You must specify one arguments - \</span>
-<span class="st"> the IP address of the VM instance&quot;</span>
+ <span class="kw">echo</span> <span class="st">&quot;You must specify two arguments:&quot;</span>
+ <span class="kw">echo</span> <span class="st">&quot;(1) the IP address of the VM instance&quot;</span>
+ <span class="kw">echo</span> <span class="st">&quot;(2) the user name&quot;</span>
<span class="kw">exit</span> 1
<span class="kw">fi</span>
-<span class="kw">ssh</span> -i ../config/test.pem -l <span class="kw">test</span> <span class="ot">$1</span></code></pre>
+<span class="kw">ssh</span> -i ../config/test.pem -l <span class="ot">$2</span> <span class="ot">$1</span></code></pre>
<ol start="62" style="list-style-type: example">
<li><code>06-nova-volume-create.sh</code></li>
</ol>
View
BIN doc/openstack-centos-kvm-glusterfs-guide.pdf
Binary file not shown.
View
13 doc/src/openstack-centos-kvm-glusterfs-guide.md
@@ -2010,19 +2010,22 @@ nova boot --image ubuntu --flavor m1.small --key_name test ubuntu
(@) `05-ssh-into-vm.sh`
This script shows how to SSH into a VM instance, which has been injected with the previously
-generated `test` key. The script accepts one argument: the IP address of the VM instance.
+generated `test` key. The script accepts two arguments: the IP address of the VM instance, and the
+user name. To connect to an instance of the Ubuntu Cloud image, the user name should be set to
+`ubuntu`.
```Bash
# SSH into a VM instance using the generated test.pem key.
-if [ $# -ne 1 ]
+if [ $# -ne 2 ]
then
- echo "You must specify one arguments - \
- the IP address of the VM instance"
+ echo "You must specify two arguments:"
+ echo "(1) the IP address of the VM instance"
+ echo "(2) the user name"
exit 1
fi
-ssh -i ../config/test.pem -l test $1
+ssh -i ../config/test.pem -l $2 $1
```

0 comments on commit 22a5837

Please sign in to comment.
Something went wrong with that request. Please try again.