<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: My login script: create a &amp;quot;stateful&amp;quot; vCLI experience. in vSphere Command-Line Interface Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100966#M917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does use the same libraries as credstore_admin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main difference between this and fastpass is that fastpass will create accounts for you on ESX, which this doesn't do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jun 2009 14:15:44 GMT</pubDate>
    <dc:creator>admin</dc:creator>
    <dc:date>2009-06-08T14:15:44Z</dc:date>
    <item>
      <title>My login script: create a "stateful" vCLI experience.</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100964#M915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the things everyone seems to struggle with when using vCLI is just logging in. I had the same struggles so I decided to write a script to help out. The two problems I try to solve are:&lt;/P&gt;&lt;P&gt;1) I don't ever remember my server IP addresses.&lt;/P&gt;&lt;P&gt;2) I don't want to type my password every time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before you begin using this script you have to define a VI_SESSIONFILE environment variable, which defines where your session will get saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, you should note that this script takes advantage of the so-called "credential cache". Full disclosure: this cache is not cryptographically secure, similar to the observations made &lt;A href="http://get-admin.com/blog/?p=361"&gt;in this blog&lt;/A&gt;. The cache is protected by filesystem security, so you probably shouldn't use this script on a disk that you can't physically secure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With all that out of the way, here's a sample of this script in action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="code"&gt;
vmware@ubuntu:~$ vcli-login
Select the host you want to access or enter its Name/IP: 10.21.4.62
Using host 10.21.4.62
Enter your username: Administrator
Enter password: Session information saved.
Login succeeded. Caching credential.
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I just logged in to a vCenter server, whenever I want to run a command I have to use -h. Here I list the NICs on one of my hosts.&lt;/P&gt;&lt;PRE __jive_macro_name="code"&gt;
vmware@ubuntu:~$ vicfg-nics -l -h 192.168.1.11
Name    PCI     Driver     Link Speed    Duplex MAC Address        MTU    Description                                  
vmnic0  02:00.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:fb         Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
vmnic1  02:03.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:05  1500   Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
vmnic2  02:04.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:0f         Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
vmnic3  02:05.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:19         Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now let me switch to a different server, this time an ESX server.&lt;/P&gt;&lt;PRE __jive_macro_name="code"&gt;
vmware@ubuntu:~$ vcli-login
Available hosts:
[1] 10.21.4.62
Select the host you want to access or enter its Name/IP: 10.21.1.83
Using host 10.21.1.83
Enter your username: root
Enter password: Session information saved.
Login succeeded. Caching credential.
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I don't need -h.&lt;/P&gt;&lt;PRE __jive_macro_name="code"&gt;
vmware@ubuntu:~$ vicfg-nics -l
Name    PCI     Driver     Link Speed    Duplex MAC Address        MTU    Description                                  
vmnic0  03:00.0 bnx2       Up   1000Mbps Full   00:1e:4f:3f:04:e4  1500   Broadcom Corporation Broadcom NetXtreme II BCM5708 1000Base-T 
vmnic1  07:00.0 bnx2       Up   1000Mbps Full   00:1e:4f:3f:04:e6  1500   Broadcom Corporation Broadcom NetXtreme II BCM5708 1000Base-T 
vmnic2  0a:00.0 e1000e     Down 0Mbps    Half   00:15:17:74:4a:fe  1500   Intel Corporation 82571EB Gigabit Ethernet Controller 
vmnic3  0a:00.1 e1000e     Down 0Mbps    Half   00:15:17:74:4a:ff  1500   Intel Corporation 82571EB Gigabit Ethernet Controller 
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I switch back to my vCenter, taking advantage of the fact that my credentials are cached. Note that I don't enter a password.&lt;/P&gt;&lt;PRE __jive_macro_name="code"&gt;
vmware@ubuntu:~$ vcli-login 10.21.4.62
Using host 10.21.4.62
Using user Administrator. You can override this by re-running the command with a user specified.
Session information saved.
vmware@ubuntu:~$ vicfg-nics -l -h 192.168.1.11
Name    PCI     Driver     Link Speed    Duplex MAC Address        MTU    Description                                  
vmnic0  02:00.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:fb         Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
vmnic1  02:03.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:05  1500   Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
vmnic2  02:04.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:0f         Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
vmnic3  02:05.0 e1000      Up   1000Mbps Full   00:0c:29:ef:17:19         Intel Corporation Abstract PRO/1000 MT Single Port Adapter 
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script is attached, hopefully someone will find it useful. Note that script only works on Linux. If you have any improvements or suggestions let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 23:41:17 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100964#M915</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2009-06-05T23:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: My login script: create a "stateful" vCLI experience.</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100965#M916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like a neat script, will have to give it a try when I get some time. It sounds like a &lt;STRONG&gt;'ghetto'&lt;/STRONG&gt; version of vi-fastpass &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.vmware.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed the code base was similar to that of &lt;A href="http://www.vmware.com/support/developer/viperltoolkit/viperl40/doc/credstore_admin.html"&gt;credstore_admin.pl&lt;/A&gt; from the vSphere SDK for Perl? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=========================================================================&lt;/P&gt;&lt;P&gt;William Lam&lt;/P&gt;&lt;P&gt;VMware vExpert 2009&lt;/P&gt;&lt;P&gt;VMware ESX/ESXi scripts and resources at: &lt;A href="http://engineering.ucsb.edu/~duonglt/vmware/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-9852"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-3075"&gt;VMware Code Central - Scripts/Sample code for Developers and Administrators&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twitter.com/lamw"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find this information useful, please award points for "correct" or "helpful".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2009 02:06:51 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100965#M916</guid>
      <dc:creator>lamw</dc:creator>
      <dc:date>2009-06-08T02:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: My login script: create a "stateful" vCLI experience.</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100966#M917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does use the same libraries as credstore_admin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main difference between this and fastpass is that fastpass will create accounts for you on ESX, which this doesn't do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2009 14:15:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100966#M917</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2009-06-08T14:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: My login script: create a "stateful" vCLI experience.</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100967#M918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If anyone tried this script and found it not working, I've updated it to reflect a change that was made between vCLI RC and vCLI GA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Carter Shanklin&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.vmware.com/vipowershell"&gt;Read the PowerCLI Blog&lt;/A&gt;&lt;BR /&gt; &lt;A href="http://twitter.com/cshanklin"&gt;Follow me on Twitter&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2009 23:19:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/My-login-script-create-a-quot-stateful-quot-vCLI-experience/m-p/2100967#M918</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2009-08-17T23:19:01Z</dc:date>
    </item>
  </channel>
</rss>

