标签: bash

  • OmniOS Shell Env Check List

    bash Shell

    ~/.profile

    #!/bin/bash
    # Solaris 衍生的 OS,默认都将 GNU 路径放在前面
    # 而支持 ACLs 的 ls/chmod ,是在 /usr/bin 目录中的
    export PATH=/usr/bin:/usr/sbin:/sbin:/usr/gnu/bin
    
    export TERM=xterm-color
    
    # Enable color support of ls and also add handy aliases
    if [ -x /usr/bin/dircolors ]; then
        test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
        alias ls='/usr/bin/ls --color=auto'
        #alias dir='dir --color=auto'
        #alias vdir='vdir --color=auto'
    
        alias grep='grep --color=auto'
        alias fgrep='fgrep --color=auto'
        alias egrep='egrep --color=auto'
    fi
    
    # Some more ls aliases
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'
    

    ~/.vimrc

    set nocp
    set bs=2
    syntax on
    

    ./.inputrc

    "\e[1~": beginning-of-line     # Home
    "\e[4~": end-of-line           # End
    "\e[5~": beginning-of-history  # PageUp
    "\e[6~": end-of-history        # PageDown
    "\e[3~": delete-char           # Delete
    "\e[2~": quoted-insert         # Insert
    "\eOD": backward-word          # Ctrl+Left
    "\eOC": forward-word           # Ctrl+Right
    

    /etc/default/init

    TZ="Asia/Shanghai"
    CMASK=022
    LANG=en_US.UTF-8
    
  • NexentaStor下获取真正的root权限

    NexentaStor一切都被封装得严严实实,即使用ssh下用root登录到它的NMC(Nexenta Management Console)也是如此。当然了,这主要还是为了安全计——如果这台机器这个OS下的系统专用作存储服务,似乎真实的root shell确已无必要,使用其WEB界面的NMV及字符界面的NMC就已足够。但凡事总有例外,如果NexentaStor运行在ESXi下,像VMware tools之类的安装活儿,你还非得真正的UNIX shell不可。

    NexentaStor其实就是Solaris开源分支的一个封装发行,那么我们怎样找到熟悉的UNIX bash呢?我们来搞搞震吧!

    在NexentaStor启动使用root登录之后,你进入的是NMC shell,不管如何,先使用你的"root"账号登录,然后遵循以下步骤:

    nmc@homenas:/$ option expert_mode = 1 nmc@homenas:/$ !bash You are about to enter the Unix ("raw") shell and execute low-level Unix command(s). Warning: using low-level Unix commands is not recommended! Execute?  (y/n)

    按"y"之后,熟悉的bash#就回来了!

    nmc@homenas:/volumes#

    好吧,现在你可以为所欲为了!

    退出这个bash shell的时候,注意系统的提示。

    nmc@homenas:/volumes# exit exit

    Important: To re-sync the appliance's management state information, please consider running 'setup appliance nms restart' command.

    nmc@homenas:/$

    为系统完整性考虑,你应该考虑运行它建议的命令"setup appliance nms restart"。