Page Actions
Wiki Actions
User Actions
Submit This Story

VIOS Commands, What's Behind

One should never work as root on VIO servers. Login as user padmin and type

$oem_setup_env

you get the root credentials (password not required). Checking /etc/passwd we found that padmin uses a *restricted* K shell:

padmin:!:10:1::/home/padmin:/usr/bin/rksh

Upon checking the vios amin user padmin's .profile, the true nature of vios commands reveals…

Nature

A segment of /home/padmin/.profile

export PATH=/usr/ios/cli:/usr/ios/utils:/usr/ios/lpm/bin:/usr/ios/oem:/usr/ios/ldw/bin:$HOME
 
 
if [ $LOGNAME = "padmin" ]
  then ioscli license -swma
fi
 
export SHELL=/usr/bin/ksh
alias backup="ioscli backup"
alias restore="ioscli restore"
alias chbdsp="ioscli chbdsp"
alias mvbdsp="ioscli mvbdsp"
alias rmsp="ioscli rmsp"
alias mkrep="ioscli mkrep"
alias chrep="ioscli chrep"
alias lsrep="ioscli lsrep"
alias rmrep="ioscli rmrep"
alias mkvopt="ioscli mkvopt"
alias chvopt="ioscli chvopt"
alias rmvopt="ioscli rmvopt"
alias loadopt="ioscli loadopt"
...

Made a guess, and we run vios commands as root instead of padmin:

/usr/ios/cli/ioscli lsmap -all

By setting aliases and PATH one can use vios commands easily on root.

Furthermore, to reveal what AIX command is behind the padmin command we can change the debug level:

$export CLI_DEBUG=33

Try some vios commands, extra info will be shown:

$ioslevel
AIX: "cat /usr/ios/cli/ios.level "
2.2.0.0

Discussion

MeaCulpa, 2011/04/07 02:36

Well, I actually have done some brutal toying on my VIOSs. This is added to my .zshrc:

# Access VIOS Commands
if [[ -a /usr/ios/cli/.profile ]]; then source /usr/ios/cli/.profile; export CLI_DEBUG=33; fi

That enables me staying at root and can do *MOST* padmin ioscli commands

Enter your comment
 
 
blog/2011/02/vios_aix.txt · Last modified: 2011/02/12 01:49 by MeaCulpa     Back to top
Recent changes RSS feed Creative Commons License Powered by PHP Driven by DokuWiki