1: ifconfig
show ip address: ifconfig -a
disable(enable) ethernet card: ifconfig e1000g0 down (up)
network service: svc:/network/physical:default
network interface file: /etc/hostname. xxn /etc/inet/hosts
/etc/hosts ---> /etc/inet/hosts
/etc/inet/hosts file is a local database that associates the IP address of hosts with their names.
2: hostname
the host name of a system is contained in three files. changing a hostename must edit these three files and reboot the system.
/etc/nodename
/etc/hostname.xxn
/etc/inet/hosts
if crash dump is enabled on the system. you also need to edit /var/crash
3: ipaddress
/etc/inet/hosts
/etc/inet/ipnodes
the ipnodes file is a local database that associates the names of nodes with their IP addresses.
4: sys-unconfig
/usr/sbin/sys-unconfig can undo a system's configuration (including Ip address,gateway,hostname etc...)
it will reconfigure system after reboot.
5:inetadm
to determine if the telnet facility is enabled,use the following command.
inetadm | grep telnet
to disable the telnet facility
inetadm -d telnet
to enable the telnet facility
inetadm -e telnet
to list the current state of all network facilities:
inetadm
6: nfs server and client
NFS server files
/etc/dfs/dfstab list the local resources to share at boot time(add your shared files to this document)
/etc/dfs/sharetab list the resources currently being shared by the NFS server.
/etc/dfs/fstypes list the default file system types for remote file systems.
/etc/rmtab list file system remotely mounted by NFS clients. (list who mounted this server's directory)
/etc/default/nfs contains parameter values for NFS protocols and NFS daemons.
/etc/nfs/nfslog.conf lists information defining the location of configuration logs used for NFS server logs
/etc/default/nfslogd lists configuration information describing the behavior of the nfslogd daemon for NFS2/3.
<!--WizRtf2Html Charset=0 -->
<!--WizRtf2Html Charset=0 -->
the contents of /etc/dfs/dfstab file are readed when:
the system in multi-user-server milestone
the superuser runs the shareall command.
the superuser enables the svc:/network/nfs/server service.
NFS server daemons
mountd handles file system mount requests from remote systems.and provides access control started by service: svc:/network/nfs/server
nfsd handles client file system requests started by service: svc:/network/nfs/server
statd this daemon works with the lock manager lockd daemon to provide crash recovery functions for the lock manager
started by service: svc:/network/nfs/status
lockd record locking operations for NFS files. started by service: svc:/network/nfs/lockmgr
nfslogd provides operational recording for an NFS server configuration file: /etc/nfs/nfslogd.conf
nfsmapid the nfsmapid maps owner and group identification that both the nfsv4 client and server use. configuration file: /etc/default/nfs
NFS server commands
share
share -o ro -d " data files" /usr/local/data default is read and write
share -F nfs -o ro=client1:client2,rw=client3:client4,root=client4 directory
this command shares the directory to the four hosts only.
client1 and client2 have read-only access. client3 and client4 have read-write access . the root user from host client4 has root privilege access to the shared directory and its contents.
unshare unshare /usr/lolcal/data
shareall share all files in /etc/dfs/dfstab
unshareall
dfshares display resources currently being shared by the local server
dfsshares hostname dfsshares command displays other resources shared by other servers. dfshares szcadm
dfmounts a list of directories on the server that are currently mounted and displays the corresponding client names.
NFS client accessing Remote file resource.
mount [-F nfs] [-o option] server:pathname mount_point
mount -o ro mysolaris:/usr/local /mountpoint
7 mount option
7: Name Services
All Solaris OS systems use the /etc/nsswitch.conf file as the name service switch file.
nsswitch.conf indicates the order in which these services should be accessed.
8 getent
The getent command retrieves a list of entries from the administrative database specified. the sources for the database are specified in the /etc/nsswitch.conf file.
getent database [key]
database: passwd, group, hsots, ipnodes,services, protocols, ethers, networks, or netmasks
getent passwd xcollin
xcollin:x:512:1:SA-Xu, Collin:/export/home/xcollin:/usr/bin/bash
getent group 14
sysadmin::14:
getent hosts hostname
8 DNS
editing DNS client configuration files
/etc/resolv.conf
nameserver : IP address of a name server for the DNS domain.
domain: local domain name
search: proviides a list of domain names, separated by spaces or tabs.
/etc/nsswitch.conf
adding "dns" to "hosts: files " line, like below:
hosts: files dns
9 LDAP
1:configure the LDAP in installation
2: Initializing the native LDAP client
execute the ldapclient command for only once.
ldapclient init -a proxyPassword=proxy -a proxyDN=cn=proxyagent,ou=profile,dc=suned,dc=sun,dc=com -a domainname=suned.sun.com 192.168.0.100
init : init the host as an LDAP client
proxyPassword: the password for the proxyagent
proxyDN: the DN for the proxyagent
domainname
192.168.0.100: LDAP server IP address
3: copying the /etc/nsswitch.ldap file to /etc/nsswitch.conf file
view current client's local ldap configuration:
ldapclient list
listing LDAP entries:
ldaplist list all the containers in the current search bashDN. (list the leaves of a tree)
unconfiguring LDAP client:
ldapclient uninit this command removes the client files from the /var/ldap directory and restores the previous /etc/nsswitch.conf file.
4: ssh connection
Using ssh to connect to another machine with root
5: sendmail (linux)
1): add sendmail server to /etc/hosts file
165.204.233.100 suzsmtp.amd.com suzsmtp mailhost
2): create ~root/.forward file ,add your email to this file. when root user receive this mail this will forword this mail to you.
3): check sendmail service
service sendmail status
4): send a test mail.
echo "hello world" | mail -s "hello world" root
6: motd (linux and solaris)
If you want to publish some notice after every user sign in.
you can edit /etc/motd file .
Adding what you want to every user know in this file.
7: look solaris cpu and mem information
cpu: psrinfo -v
mem: prtconf | grep Mem