Hacker attack? More here!
reboot -- -r (≈ boot -r)
shutdown
boot
or boot disk
(when machine forgot from where to boot and tries to boot from net)
reboot into single user mode: reboot [option] -- -s
boot into single user mode: boot -s
To interrupt an infinite loop during startup (Sun keyboard): STOP - A
(key combination)
or to reach the 'ok' prompt (even without a Sun keyboard): init 0
boot cdrom
(starts by default installation procedure)
To boot from a CD ROM into single user mode (no installation, # prompt): boot cdrom -s
(use same Solaris CD as installed). Then, to make necessary changes in root directory:
# mount /dev/dsk/c0t0d0s0 /mnt
# cd /mnt/directory_you_want
# ...
# umount /mnt
STOP - A (key combination)
ok boot
If system won't reboot because it cannot find the kernel, try
STOP - A (key combination)
set-default boot-file
Stop the operating system and reboot to the state 6 as defined by the initdefault entry in /etc/inittab.
shutdown -i6 -y < /dev/console > /dev/console 2>&1
Learn about current disk usage
df or df -hor alternatively
/usr/ucb/df
Learn about history of machine usage
cd /var/adm less messages(check also messages.i, e.g. messages.0, messages.1 etc.) and
cd /var/log less syslog(check also syslog.i, e.g. syslog.0, syslog.1 etc.).
As root run
snoop
Configurations of network services are all made within file
/etc/inet/inetd.confStandard configuration of Sun out of the box leaves many services open, which are not really needed on our machines. They should be turned off to prevent hacker attacks. This is the case for the following services:
telnet, name, shell, exec, comsat, talk, uucp, finger, time, echo, discard, daytime, chargen, 100232/10, rquotad/1, rusersd/2-3, sprayd/1, walld/1, rstatd/2-4, rexd/1, 100083/1 fs, 100235/1, 100134/1, printer, 100234/1
For security reasons access to servers is also best controlled by restricting it to specific clients only, typically specified by IP numbers. Find info on Unix command hosts.allow (tcpwrappers) here and also here
In this context the following commands are probably useful:
nslookup atitlan
| to learn about the IP# and canonical name of any host |
ifconfig -a | to learn about the local server information |
Learn about current users
listusers
As root enter e.g. user luckyboy
who should belong
to the groups sysecol
and forclim
by:
useradd -G sysecol,forclim -s /usr/bin/tcsh -c "Lucky Boy" -m luckyboyNote on the okee the tcsh is at another location, i.e. the command becomes:
useradd -G sysecol,forclim -s /usr/local/bin/tcsh -c "Lucky Boy" -m luckyboyAs a result the user is created, a home directory
luckyboy
is created, all files and directories such as a .login
file etc. are
copied from /etc/skel
to the new user directory.
useradd
is /usr/sbin/useradd
.
The next mandatory step is to set the password to unlock the account.
Type
passwd -d luckyboyHowever, this is rather dangerous, since anybody who logs in as the user
luckyboy
can enter a new password and hereby grab the account.
Better is
passwd luckyboyand set it to some standard password known to the user. Force the setting of a new password by
passwd -f luckyboy
Lock an account by
passwd -l luckyboyUnlock it as if the user has recently been created as a new user, i.e.
passwd luckyboy standardpw standardpw ; passwd -f luckyboy
Use vipw
to check the result or for some quick editing
of the settings (vipw
allows also for easy updating of
the shadow file and enforces exclusive root editing)
There is also userdel
available, however which has not a
fully symmetrical behavior, i.e. it won't remove a user's home directory.
see also Frisch, p. 176ff. (adding users), 188ff. (removing users) for more
I have written two small scripts to add or remove a user. They are:
openUserAcc
and closeUserAcc
.
Ex.:
openUserAcc luckyboy "Lucky Boy, Tel. 1-2345, luckyboy@domain.etzh.ch" closeUserAcc luckyboy
To add a user to an existing group once its account has
already been created, edit the file /etc/group
as root.
E.g. have the line:
forclim::14432:lmatile,bprice,ctheatoThis means all listed users (login names) belong to the group
forclim
. The listed users have permission to access directories
or files, which belong to the respective group, in this case forclim
.
The owner of an object can change its group permissions, e.g. with
command
chgrp -R forclim fcdirthe owner of directory
fcdir
would change recursively the directory
fcdir
and all the objects contained within for access by group forclim
.
Subsequently any member of the group forclim
can then access the
directory fcdir
and all what it contains.
To set permissions use command chmod
. E.g. give the group
owners, whatever that might be, read and write access to an entire branch
of the filesystem without altering any other settings use command
chmod -R g+rw fcdirThis will add recursively to the directory
fcdir
and to all
the objects contained within read and write access by the group owners in
addition to whatever settings the involved items might currently have.
Applicable codes:
u - user (owner) g - group o - other (world) + add - remove = set exactly to (overwrites) r - read w - write x - executeIf the group should have exactly the same permissions as the owner, whatever that might be use command
chmod -R g=u fcdir
If you have difficulties to modify the directory /home
as root, there might be the automounting demon autofs
running.
If this daemon is running you always get the error message
"can't change home"
in any attempt to modify this directory.
To temporarily stop this demon execute
/etc/init/d./autofs stopTo permanently disable this demon rename
/etc/rc2.d/SXXautofs
like this:
mv /etc/rc2.d/SXXautofs /etc/rc2.d/sXXautofswhere XX stands for any two digits.
To learn about all available groups execute
groupssince command groups is legacy and may be deprecated in future, better use equivalent
id -GnTo learn about all the groups a specific user, say
smith
, belongs to, execute
id -Gn smith
To learn about the UID of a specifc user, say smith
, execute
id -u smithas alias, say
uid
alias uid='id -u'
To learn about the GID of a specific group, say _lpoperator
, execute
grep _lpoperator /etc/group | sed -E "s/.*:([0-9]+):.*/\1/"as shell script, say
gid
stored as executable in ~/bin
#/bin/sh if [ "$1" == "" ]; then echo "Usage: gid <groupname>" ; exit 1; fi grep $1 /etc/group | sed -E "s/.*:([0-9]+):.*/\1/"and then the alias, say
gid
too (without having to touch
environment variable PATH)
alias gid=~/bin/gid
quotas
/usr/bin/touch quotas
/usr/bin/chmod 600 quotas
Once file quotas
exists, edit for each user
you wish to set a quota this file
quotas
by
/usr/sbin/edquota <user>
Note, edquota
works like vi
.
Edit the parameters (0 means unlimited) similar to this
fs /acct/s1 blocks (soft = 95000, hard = 100000) \
inodes (soft = 9000, hard = 10000)
where the soft limit should be slightly lower than the hard
limit values.
(see also:
http://www.ifh.ee.ethz.ch/~ballisti/computer_topics/diskquota-sol7.html)
rass
). This requires non-standard Solaris 9 software, notably
a secure
shell (OpenSSH), since standard
Solaris 9 contains a sftp with insufficient
functionality (compare with OpenSSH sftp)./usr/local
. Note that
directory is actually physically on the se-server and only mounted via
nfs on any cluster node. Thus software needs to be installed only once
on the se-server and is then immediately available to all nodes from
the cluster (not even a need for a restart). For further information
on our cluster of simulation servers see here.
FLEXlm
stands for FLEXible license manager system.
Important, for a license to be fine,
you need a demon called lmgrd
,
which is always running.
lmgrd
may spawn other demons like
EPC
(for epc Modula-2 license).
The machine on which
lmgrd
is running is called the license server
and need not
be the same machine as on which the licenses software is
executed.
lmgrd
needs to be launched once and requires
a so-called license file, e.g.
/usr/local/flexlm/licenses/license.dat
.
The lmgrd
can be launched by any user,
on inawa preferably by executing the installed script
FLEXlm
with this command:
FLEXlm start
Inspect the status of the license with
FLEXlm status
which should return something similar to this:
> FLEXlm status
lmstat - Copyright (C) 1989-1997 Globetrotter Software, Inc.
Flexible License Manager status on Sat 3/11/2000 12:52
License server status: 1700@inawashiro-ko
License file(s) on inawashiro-ko: /usr/local/flexlm/licenses/license.dat:
inawashiro-ko: license server UP (MASTER) v6.0
Vendor daemon status (on inawashiro-ko):
EPC: UP v2.4
idl_lmgrd: UP v6.0
However, only root can stop the license manager
properly (never simply kill it, or you might corrupt the license):
FLEXlm stop
However, all in all, there is little need to do any starting or
stopping of lmgrd demons explicitely,
since on inawa the script FLEXlm is properly installed
to start automatically at launch time (level 3, i.e. the
directory /etc/rc3.d contains symbolic links named
S30lmgrd.license
and
K30lmgrd.license
pointing at script
/etc/init.d.adm/lmgrd.license
which uses /bin/FLEXlm
).
FLEXlm log
returns you all what happened in terms of the license
demon activities.
epc Modula-2 Its installation is described in all
details in the file
EPC-M2_2.0.9.5_Install.TXT (access restricted)
em2 man
(manual for em2 (epc Modula-2 driver = compiler,linker) Version 2.0.6)
em2 Make utility
(manual for em2 Make utility)
EPC
now ADI - Edinburgh Design Centre (DSP Tools group)
Workshop IDES Source for Sun software. Workshop consists of the following components:
SPARCworks C 5.0 SPARCworks C++ 5.0 SPARCworks F77 5.0 SPARCworks F90 2.0 SPARCworks dbx 5.0 SPARCworks LockLint 2.2 SPARCworks LoopTool 2.2 SPARCworks/TeamWare 2.1 SPARCworks/IPE 5.0 SPARCworks/Visual 5.0ieee_flags and ieee_handler needed by DMFloatEnv can only be obtained by installing a Sun language package, i.e. one component of Workshop
Sun Software Administration Sun Product Documentation Describes all of Sun's software in detail. Very useful!
System administrator uses vipw
(edits also /etc/stmp)
to specify the initial shell for every user as listed in file /etc/passwd
(owned by root with exlusive write rights!).
/etc/shells (inawa only) lists all shells available as user's shells.
Shell executable file | Shell name | Config files (global) | Config files (HOME) | Comment |
/sbin/sh /usr/bin/sh /bin/sh (normally) |
Bourne shell | /etc/profile | .profile | works always, e.g. required by root for urgency maintenance |
/usr/bin/csh /bin/csh (normally) |
C shell | /etc/.login | .cshrc, .login | I recommend to refrain from using csh, use tcsh instead, or better none at all (Csh Programming Considered Harmful). |
/usr/bin/tcsh (inawa, okee) /usr/local/bin/tcsh (okee) /bin/tcsh (normally) |
extended C shell | /etc/csh.cshrc 1, /etc/csh.login1 | .tcshrc (or if missing .cshrc), .login | a convenient shell to work with, since it offers history, file name extension by TAB etc. However, see notes above. |
/usr/bin/ksh /bin/ksh (normally) |
Korn shell | /etc/profile | .profile | Both files only read during login2 |
/usr/bin/bash /bin/bash (normally) |
Bourne again shell | /etc/profile | .bash_profile, .bash_login, .profile (stops after first found) .bashrc |
A Bourne shell compatible replacement with C, Korn shell like enhancements. |
/bin/false | Pseudo shell | For users who will never login | ||
/bin/sh (unless specified) | su | /etc/default/su | /etc/default/su | For system administration (cf. man su) |
1 The behavior of the /usr/local/bin/tcsh
(SunOS >= 5.6) differs to that of /usr/bin/tcsh
(= /bin/tcsh
on inawa, UNIX(r)
System V Release 4.0). It is not what it should be AFAIK,
i.e. the two global files are ignored.
Instead just /etc/.cshrc
and /etc/.login
are sourced,
i.e. etc/csh.cshrc
and etc/csh.login
are ignored.
Fortunately the local .tcshrc
file is sourced as it should.
2 If you wish the Korn shell to read a file at its launch
time, set environmental variable ENV to that file. E.g. on the huron
/etc/profile
defines ENV=~/.kshrc
.
The default shell is the bash shell, which reads
/etc/profile
during each login. Thus you can use a local
.kshrc
file in your home directory to customize the
behavior of the Korn shell.
above tested on inawa.ethz.ch (January 2000, af)
files are listed in sequence of execution; global files are executed first, but only for ordinary users (e.g. not for root).
Any global .profile, or *.login files are ONLY executed at login. However, e.g. .cshrc files are executed whenever you launch a new shell, e.g. by typing csh. Note, the tcsh differs from all other shells, since it does also execute once more the global configuration file, i.e. /etc/etc.cshrc (or /etc/.cshrc if /etc/.tcshrc). However, under OS X using application /Applications/Utilities/Terminal.app, any opening of a new window is considered a login and will thus source .profile once.
The bash shell does NOT execute .bashrc during login. However, every subsequent invocation of a bash shell will execute the file .bashrc from your home directory.
Templates for local .login, .cshrc etc. files are stored at /etc/skel
see also Frisch, p. 164 for more on this topic. Apple's Shell Scripting Primer contains also lots of useful and well explained information on scopes of variables (environment, global, local variables) and their passing when executing or sourcing scripts and routines.
Access to a login shellAll users should be able to access a shell only through
ssh
(Installing OpenSSH Packages for SPARC under Solaris 8;
further links:
Installing OpenSSH on the Solaris 8 OS,
Unixguide ssh installation for Solaris 8).
Telnet, rlogin, rsh, rcp
services are insecure and should all be disabled.
To disable telnet
simply comment in file /etc/inetd.conf
the line starting with telnet
. To disable that
root can login from anywhere else than the system console,
edit in file /etc/default/login
the line containing CONSOLE
as follows
However, these settings do not affect CONSOLE=/dev/console
ssh
. For more on this see
Why can't I rlogin/telnet in as root?.
/etc/init.d/atalk stop
/etc/init.d/atalk start
as root in dirNetatalk+Asun under Solaris howto/home/admin/
unpacknetatalk-1.4b2+asun2.1.3.tar
creates dirnetatalk-1.4b2+asun2.1.3/
netatalk needs to be built and installed according to README files but with following specialities: - DESTDIR = /usr/local/atalk - ATALKD.CONF: on inawa instead ofle0
writehme0
- The following definitions commented, since not to be used: TCPWRAPDIR PAMDIR Authentication DESDIR Verschlüsselung - manuals => /usr/share/man in section 8
edit man configuration file, i.e./usr/man/man.cf
, by inserting section 8
complete installation withcatman 8
test installation withman atalkd
/etc/init.d/sendmail stop
/etc/init.d/sendmail start
sendmail
.inawashiro-ko.root[]61: ls /etc/rc?.d/*sendmail /etc/rc0.d/K57sendmail /etc/rc1.d/K57sendmail /etc/rc2.d/S88sendmail
inawashiro-ko.root[]61: ls /etc/rc?.d/*sendmail /etc/rc0.d/k57sendmail /etc/rc1.d/k57sendmail /etc/rc2.d/s88sendmail
On okeechobee I used the standard configuration. It allows to send
E-mail within the same machine from user to user. To additionally
enable sending of mail to the outer world, i.e. to the SMTP server
groupw1.ethz.ch
, I needed simply to insert in
/etc/hosts
a new line which defined the alias mailhost
as follows:
129.132.97.47 mailhost
After that I could easily send out mail (but not receive any,
unless demon sendmail is started).
BTW: Learn about the IP# of a host by
# /usr/sbin/nslookup groupw1.ethz.ch
Server: dns1-rz-fddi.ethz.ch
Address: 129.132.98.12
Name: groupw1.ethz.ch
Address: 129.132.97.47
FAQ sendmail; see also Frisch, p. 635 for more
ides:/anonymous
,
like this
cd /net/ides/anonymous
ifconfig -a
to learn about IP# (inet) etc.
pkgadd -d
to install a package
coreadm -d global
to disable global core
dumps. If these are enabled (default configuration Solaris 9), each process
that expires produces 2 core
files, one in the current directory, the other in the global core file
path (default: /var/core). This can cause OVERFLOW of root partition!
coreadm -d global-setid
to disable
global-setid core dumps.
coreadm
to display current core dump
configuration.
domainname
have a file /etc/defaultdomain
which
contains just the domainame text,
e.g. inawa.ethz.ch
.
You are free to use any domainname you wish (?).
Otherwise set it on the fly as root with
domainname inawa.ethz.ch
drvconfig;devlinks;disks
Systems Ecology staff addresses and phone numbers (access restricted)
A list of IP numbers as used by our computers (access restricted) etc. of our servers
To shutdown a Sun read this.
The master for this document is here (access restricted).
Back to:
Top of page
Terrestrial Systems Ecology
Environmental Physics (UP)
Institute of Biogeochemistry and Pollutant Dynamics (IBP)
Partner institutes:
Institute for Atmospheric and Climate Science (IAC)
Institute of Integrative Biology (IBZ)
Department of Environmental Systems Science
ETH Zurich
Responsible for content: Andreas Fischlin
or contact Webmaster ( Last modified 10/29/24 )