SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


aixprofile
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

aixprofile [2013/01/26 20:08] (current)
sjoerd created
Line 1: Line 1:
 += AIX Profile
  
 +Everything on this page is usable for as well AIX 5.3 as 6.1. 
 +
 +== Change the prompt to something useful
 +
 +Change the /​etc/​security/​.profile file:
 +<​code>​
 +PATH=/​usr/​bin:/​etc:/​usr/​sbin:/​usr/​ucb:​$HOME/​bin:/​usr/​bin/​X11:/​sbin:​.
 +
 +# Set the prompt to username@hostname:/​current/​directory
 +HOST=$(hostname -s)
 +PS1='​$USER@$HOST:​$PWD>'​
 +
 +# Set environment for Korn Shell
 +ENV=$HOME/​.kshrc
 +
 +export PATH HOST PS1 ENV
 +
 +if [ -s "​$MAIL"​ ]           # This is at Shell startup. ​ In normal
 +then echo "​$MAILMSG" ​       # operation, the Shell checks
 +fi                          # periodically.
 +
 +</​code>​
 +
 +Don't forget to copy the profile file to the home directory of existing users.
 +
 +== Change the terminal windows title
 +
 +If you use a terminal that supports the TERM environment (like putty) setting you can also do the same to the windows title. Add, according to your preferences the correct piece of code to the .profile file:
 +
 +<​code>​
 +case $TERM in
 +   ​(xterm*)
 +         ​PROMPT_COMMAND='​echo -ne "​\033]0;​${HOST}:​ ${PWD}\007"'​
 +;;
 +esac
 +</​code>​
 +
 +Will give you:
 +
 +<​code>​
 +hostname:/​current/​directory
 +</​code>​
 +
 +And:
 +
 +<​code>​
 +case $TERM in
 +   ​(xterm*)
 +         ​PROMPT_COMMAND='​echo -ne "​\033]0;​${USER}($(id -ng))@${HOST}:​ ${PWD}\007"'​
 +;;
 +esac
 +</​code>​
 +
 +Will give you:
 +
 +<​code>​
 +user(ssh-access)@hostname:/​current/​directory
 +</​code>​
 +
 +For more information,​ also on adding the Oracle instance to your prompt or windows title see [[http://​www.rootvg.net/​content/​view/​186/​89/​|here at rootvg]]. \\
 +
 +== Set the korn shell
 +
 +Create or change the /​home/​user/​.kshrc file:
 +<​code>​
 +set -o vi
 +alias c=clear
 +alias dir='​ls -l'
 +alias ll='ls -l'
 +</​code>​
 +
 +== Set vi
 +
 +Create or change the /​home/​user/​.exrc file:
 +<​code>​
 +set showmode
 +set number
 +</​code>​
 +
 +This will automatically show the line numbers and show the mode of vi your working in, like input or replace. If you don't want to show the vi numbers issue this command inside vi:
 +
 +<​code>​
 +:set nonumber
 +</​code>​
 +
 +
 +== Profile possibilities
 +
 +<​code>​
 +$HOME/​.hushlogin
 +</​code>​
 +
 +If this file exists, it will suppress the displaying of the /etc/motd file (message of the day file) and the message for unsuccessful login attempts for that user account.
 +
 +<​code>​
 +set -o ignoreeof
 +</​code>​
 +
 +If this line exists in your .profile <​ctrl>​+d won't log you out
 +
 +== SKEL
 +
 +If you want the created profile to automatically be set for every newly created user create a directory ​
 +<​code>​
 +/etc/skel
 +</​code>​
 +
 +and copy the files to that directory:
 +
 +<​code>​
 +root@ms-lpar04:/​etc/​security>​cd /etc/skel
 +root@ms-lpar04:/​etc/​skel>​ls -l
 +-rw-r--r-- ​   1 root     ​system ​          24 Mar  4 12:08 .exrc
 +-rw-r--r-- ​   1 root     ​system ​          59 Mar  4 12:07 .kshrc
 +-rw-r--r-- ​   1 root     ​system ​         416 Mar  4 12:05 .profile
 +</​code>​
 +
 +Note: Don't forget to make sure everybody can read the files.
 +
 += My Own Profile
 +
 +<​code>​
 +PATH=/​usr/​bin:/​etc:/​usr/​sbin:/​usr/​ucb:​$HOME/​bin:/​usr/​bin/​X11:/​sbin:​.
 +
 +# Set the prompt to username@hostname:/​current/​directory
 +HOST=$(hostname -s)
 +PS1='​$USER@$HOST:​$PWD>'​
 +
 +# Set environment for Korn Shell
 +ENV=$HOME/​.kshrc
 +
 +# Set terminal window
 +case $TERM in
 +   ​(xterm*)
 +         ​PROMPT_COMMAND='​echo -ne "​\033]0;​${HOST}:​ ${PWD}\007"'​
 +;;
 +esac
 +
 +# Set timeout
 +TMOUT=3600
 +
 +export PATH HOST PS1 ENV TMOUT
 +
 +# Aliases
 +alias ll='ls -lrt'
 +alias c='​clear'​
 +
 +if [ $HOST = '​backend'​ ] || [ $HOST = '​backend-acc'​ ]
 +   then
 +      alias toapp="​cd /​opt/​comp/​backend/"​
 +      alias tolog="​cd /​var/​log/​comp"​
 +      alias todata="​cd /​var/​data/​comp"​
 +fi
 +
 +if [ -s "​$MAIL"​ ]           # This is at Shell startup. ​ In normal
 +then echo "​$MAILMSG" ​       # operation, the Shell checks
 +fi                          # periodically.
 +</​code>​
 +
 +{{tag>​aix}}
aixprofile.txt ยท Last modified: 2013/01/26 20:08 by sjoerd