Solaris Commands
Solaris Commands
% /usr/sadm/bin/smc &
Roles + Users
refers to name service environment that you want to use with selected management tool.
file on each system specifies the policy for name service lookups (where data is read from ) on
that system.
Applications for administrating the Solaris OS is called Tools. Stored collection --> Toolboxes
# /etc/init.d/init.whem stop
# /etc/init.d/init.whem start
# /etc/init.d/init.whem status
https://hostname.domain:6789
https://gwwpcSOLARIS:6789/zfs/zfsmodule/index
---Logging level
# wcadmin add -p -a console logging.default.level=all
#wcadmin remove -p -a console logging.default.level
---Auditing Implementation
# wcadmin add -p -a console audit.default.type=None
1-Severe errors
2-Important messages + 1
3-all possible messages with full message
--> /usr/share/webconsole/webapps/console/WEB-INF
/usr/share/webconsole/webapps/app-context-name/WEB-INF
Application Prilvileges
If u can see applications link on Java Web Console, u can run it.
Set property to allow console server to respond to network requests and restart console server
0 - 99 - Solaris OS
100 - 2147483647 - Regular Users
60001 - 65534 - nobody and nobody4
60002 - noaccess
User Password
- best solution
custom user initialization files (.login, .cshrc,
.profile) user $HOME
username:password:uid:gid:comment:home-directory:login-shell
e.g.#
The default Solaris passwd file contains entries for standard daemons.Daemons are
processes
that are usually started at boot time to perform some system-wide task, such as
printing,
network administration, or port monitoring.
root:x:0:1:Super-User:/:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:x:25:25:SendMail Message Submission Program:/:
listen:x:37:4:Network Admin:/usr/net/nls:
gdm:x:50:50:GDM Reserved UID:/:
webservd:x:80:80:WebServer Reserved UID:/:
nobody:x:60001:60001:NFS Anonymous Access User:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
The fields in the shadow file are separated by colons and contain the following
information:
username:password:lastchg:min:max:warn:inactive:expire
For example:
rimmer:86Kg/MNT/dGu.:8882:0::5:20:8978
The fields in the group file are separated by colons and contain the following
information:
group-name:group-password:gid:user-list
For example:
bin::2:root,bin,daemon
The default Solaris group file contains the following system groups that support some
system-wide task, such as printing, network administration, or electronic mail.Many
of these
groups having corresponding entries in the passwd file.
root::0:
other::1:
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
uucp::5:root
mail::6:root
tty::7:root,adm
lp::8:root,adm
nuucp::9:root
staff::10:
daemon::12:root
smmsp::25:
sysadmin::14:
gdm::50:
webservd::80:
nobody::60001:
noaccess::60002:
nogroup::65534:
User project information is stored in the /etc/project file, which can be stored on the
local
system (files), the NIS name service, or the LDAP directory service. You can use the
Solaris
Management Console to manage project information.
The /etc/project file must exist for users to log in successfully, but requires no
administration
if you are not using projects
TABLE 4–14 User Initialization Files for Bourne, C, and Korn Shells
Shell User Initialization File Purpose
Bourne $HOME/.profile Defines the user's environment at login
C $HOME/.cshrc Defines the user's environment for all C shells and is
invoked after login shell
$HOME/.login Defines the user's environment at login
Korn $HOME/.profile Defines the user's environment at login
$HOME/$ENV Defines user's environment at login in the file and is
specified by the Korn shell's ENV environment variable
The Solaris environment provides default user initialization files for each shell in the
/etc/skel
directory on each system, as shown in the following table.
TABLE 4–15 Default User Initialization Files
Shell Default File
C /etc/skel/local.login
/etc/skel/local.cshrc
Bourne or Korn /etc/skel/local.profile
You can use these files as a starting point and modify them to create a standard set
of files that
provide the work environment common to all users. Or, you can modify these files to
provide
the working environment for different types of users.
Although you cannot create customized user initialization files with the Users tool,
you can populate a user's home directory with user initialization files located in a
specified “skeleton” directory.
You can do this by creating a user template with the User Templates tool and
specifying a skeleton directory from which to copy user initialization files.
When you use the Users tool to create a new user account and select the create
home directory
option, the following files are created, depending on which login shell is selected.
At this point, you need to rename them to whatever is appropriate for the user's login
shell
The user initialization files can be customized by both the administrator and the user.
This important feature can be accomplished with centrally located and globally
distributed user
initialization files, called site initialization files.
Site initialization files enable you to continually introduce new functionality to the
user's work environment, while enabling the user to customize the user's initialization
file.
To reference a site initialization file in a C-shell user initialization file, place a line
similar to the
following at the beginning of the user initialization file:
source /net/machine-name/export/site-files/site-init-file
. /net/machine-name/export/site-files/site-init-file
You should not add specific references to the local system in the user initialization
file.
To make a user's home directory available anywhere on the network, always refer to
the
home directory with the variable $HOME. For example, use $HOME/bin instead of
/export/home/username/bin. The $HOME variable works when the user logs in to
another
system and the home directories are automounted.
Bourne
Korn
Known as the standard shell in UNIX Applicable N/A N/A
Compatible syntax with Bourne shell - N/A Applicable
Job control Applicable Applicable Applicable
History list N/A Applicable Applicable
Command-line editing N/A Applicable Applicable
Aliases N/A Applicable Applicable
Single-character abbreviation for login
directory
N/A Applicable Applicable
Protection from overwriting (noclobber) N/A Applicable Applicable
Setting to ignore Control-D (ignoreeof) N/A Applicable Applicable
Enhanced cd command N/A Applicable Applicable
Initialization file separate from .profile N/A Applicable Applicable
Logout file N/A Applicable N/A
■Shell (local) variables – Variables that affect only the current shell. In the C shell,
a set of
these shell variables have a special relationship to a corresponding set of
environment
variables. These shell variables are user, term, home, and path. The value of the
environment
variable counterpart is initially used to set the shell variable.
In the C shell,
lowercase names with the set command to set shell variables
uppercase names with the setenv command to set environment variables
set a shell variable, the shell sets the corresponding environment variable
All Shells
refer to shell and environment variables by their uppercase names
user initialization file, you can customize a user's shell environment by changing the
values
The following table describes environment variables and shell variables that you
might want to
customize in a user initialization file
Variable Description
CDPATH, or cdpath in
the C shell
Sets a variable used by the cd command. If the target directory of the cd
command is
specified as a relative path name, the cd command first looks for the target
directory
in the current directory (“.”). If the target is not found, the path names
listed in the
CDPATH variable are searched consecutively until the target directory is
found and the
directory change is completed. If the target directory is not found, the
current
working directory is left unmodified. For example, the CDPATH variable is
set to
/home/jean, and two directories exist under /home/jean, bin, and rje. If you
are in
the /home/jean/bin directory and type cd rje, you change directories to
/home/jean/rje, even though you do not specify a full path.
history Sets the history for the C shell.
HOME, or home in the C
shell
Sets the path to the user's home directory.
LANG Sets the locale.
LOGNAME Defines the name of the user currently logged in. The default value of
LOGNAME is set
automatically by the login program to the user name specified in the
passwd file. You
should only need to refer to, not reset, this variable.
LPDEST Sets the user's default printer.
MAIL Sets the path to the user's mailbox.
MANPATH Sets the hierarchies of man pages that are available
when users specify only a command name, the shell searches the directories for the
command in the order specified by the PATH variable. If the command is found in one
of the directories, the shell executes the command
The following examples show how to set a user's default path to include the home
directory and
other NFS mounted directories. The current working directory is specified first in the
path. In a
C-shell user initialization file, you would add the following:
In a Bourne-shell or Korn-shell user initialization file, you would add the following:
PATH=.:/usr/bin:/$HOME/bin:/net/glrr/files1/bin
export PATH
LocaleVariables
Value Locale
en_US.UTF-8 American English (UTF-8)
The following examples show how to set the locale by using the LANG environment
variables. In
a C-shell user initialization file, you would add the following:
In a Bourne-shell or Korn-shell user initialization file, you would add the following:
When you create a file or directory, the default file permissions assigned to the file or
directory
are controlled by the user mask. The user mask is set by the umask command in a
user
initialization file. You can display the current value of the user mask by typing umask
and
pressing Return.
Note that if the first digit is zero, it is not displayed. For example, if the user mask is
set to 022, 22
is displayed.
To determine the umask value you want to set, subtract the value of the permissions
you want
from 666 (for a file) or 777 (for a directory). The remainder is the value to use with
the umask
command. For example, suppose you want to change the default mode for files to
644
(rw-r--r--). The difference between 666 and 644 is 022, which is the value you would
use as an
argument to the umask command.
You can also determine the umask value you want to set by using the following table.
This table
shows the file and directory permissions that are created for each of the octal values
of umask.
0 rw- rwx
1 rw- rw-
2 r-- r-x
3 r-- r--
4 -w- -wx
5 -w- -w-
6 --x --x
7 --- (none) --- (none)