31 Mayıs 2012 Perşembe

Unix komutları -6



Accounts cmmands


Solaris
Red Hat
Ubuntu/Debian
HP
AIX
display users
cat /etc/passwd

logins -x
cat /etc/passwd
system-config-users (GUI)
cat /etc/passwd
cat /etc/passwd
logins -x
cat /etc/passwd

lsuser -f ALL   (detailed)
create a user
useradd
useradd
system-config-users (GUI)
useradd
useradd
sam
mkuser
useradd
remove a user
userdel
userdel
system-config-users (GUI)
userdel
userdel
sam
rmuser
userdel
modify a user
usermod
usermod
system-config-users (GUI)
usermod
usermod
sam
chuser -a
usermod
 
passwd -f
passwd -s
chfn <username>
chfn <username><shell>
change user password
passwd
passwd
passwd
passwd
passwd
pwdadm
pwdck -t ALL
create a group
groupadd
groupadd
groupadd
groupadd
mkgroup <group name>
remove a group
groupdel
groupdel
groupdel
groupdel
rmgroup <group name>
modify a goup
groupmod
groupmod
groupmod
groupmod
chgroup <attribute><group name>
password files
/etc/passwd
/etc/shadow
/etc/passwd
/etc/shadow
/etc/passwd
/etc/shadow
/etc/passwd
/tcb/files/auth/r/root (trusted system)
/etc/security/passwd
useful user commands
id -a
whoami
who
w
finger
id -a
whoami
who
w
finger
id -a
whoami
who
w
finger
id
whoami
who
w
uptime (displays # of users logged in)
finger
id
whoami
who
w
uptime (displays # of users logged in)
finger
 

# License information
 
lslicense
chlicense

# Maximum number of processes for a user
 
lsattr -D -l sys0 -a maxuproc
chdev -l sys0 -a maxuproc=<number>
useful group commands
groups
setpgrp
newgrp
groups
groups
groups
setprivgrp
groups
setgroups
lsgroup ALL

NFS commands


Solaris
Red Hat
Ubuntu/Debian
HP
AIX
NFS Daemons
server: mountd, nfsd
client: statd, lockd
server: rpc.mountd,nfsd
client: rpc.statd, lockd
server: rpc.mountd,nfsd
client: rpc.statd, lockd
server: rpc.mountd, nfsd
client: rpc.statd, lockd
server: rpc.mountd, nfsd
client: rpc.statd, rpc.lockd
NFS files
/etc/dfs/dfstab
/etc/dfs/sharetab
/etc/rmtab
/etc/exports
/var/lib/nfs/etab
/var/lib/nfs/xtab
/etc/exports
/var/lib/nfs/etab
/var/lib/nfs/xtab
/etc/exports
/etc/xtab
/etc/exports
/etc/xtab
List nfs clients that have a remote mount
/etc/rmtab
/var/lib/nfs/rmtab
/var/lib/nfs/rmtab
/etc/rmtab
/etc/xtab
display nfs shares
dfshares
showmount -e localhost
showmount -e localhost
showmount -e localhost
showmount -e localhost
exportfs
showmount -e localhost
create nfs share
/etc/dfs/dfstab (edit and add share)
share <path>
 

## dfstab example
 
share -F nfs -d "jumpstart" /export/jumpstart
redhat-config-nfs (GUI)

/etc/exports (edit and add share)
/sbin/service nfs reload

## /etc/exports example
/export *(rw,fsid=0,insecure,no_root_squash,sync)
/etc/exports (edit and add share, see below example)
exportfs -rav (export the shares)
 

/etc/init.d/portmap restart
/etc/init.d/nfs-kernel-server restart

## /etc/exports example
/export *(rw,fsid=0,insecure,no_root_squash,sync)
 
/etc/rc.config.d/nfsconf (edit)
/etc/exports (edit and add share)
exportfs -a
mknfsexp -d <directory>
mknfsmnt

shareall
uncreate nfs share
unshare <path>
/etc/dfs/dfstab (edit and remove share)
 
/etc/exports (edit and remove share)
/sbin/service nfs reload
/etc/exports (edit and remove share)
exportfs -rav (export the shares)
 
/etc/rc.config.d/nfsconf (edit)
exportfs -au (unshare all)
exportfs -u /home/vallep
 
/etc/exports (edit and remove share)
rmnfsexp  -d <directory> (unshares and removes from file) 

exportfs -u <filesystem>
 
unshareall
start/change nfs daemons
/etc/init.d/nfs.server start 
/etc/init.d/nfs.client start
svcadm enable nfs/server
svcadm disable nfs/server
/sbin/service nfs start
/etc/init.d/portmap start
/etc/init.d/nfs-kernel-server start
/sbin/init.d/nfs.core start
/sbin/init.d/nfs.server start
/sbin/init.d/nfs.client start
mknfs
chnfs
 

startsrc -s nfsd
startsrc -s rpc.mountd
stop nfs daemons
/etc/init.d/nfs.server stop
/etc/init.d/nfs.client stop
/sbin/service nfs stop
/etc/init.d/portmap stop
/etc/init.d/nfs-kernel-server stop
/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.server stop
 
/sbin/init.d/nfs.core stop
rmnfs

stopsrc -s nfsd
stopsrc -s rpc.mountd
nfs status
ps -ef|grep < nfs daemons>
/sbin/service nfs status
/etc/init.d/nfs-kernel-server status
ps -ef | grep <nfs daemons>
lssrc -a |grep -i nfs
nfs reload
shareall
/sbin/service nfs reload
exportfs -rav (export the shares)
exportfs -a
exportfs -av
nfs performanace
nfsstat
nfsstat
nfsstat
nfsstat
nfsstat
nfs Options
n/a
cat /var/lib/nfs/etab
cat /var/lib/nfs/etab
n/a
nfso -a
nfso -o <option>=<value>

exportfs (display options)
solaris/redhat mount problems (nfs v3 to v4)
## Make sure you use NFS version 3 
mount -F nfs -o vers=3 <mount> <mountpoint>
n/a
n/a
n/a
n/a

NTP commands


Solaris
Red Hat
Ubuntu/Debian
HP
AIX
Time daemons
xntpd
ntpd
ntpd
xntpd
xntpd
ntp setup
# Solaris 8 
/etc/ntp.conf
/etc/ntp.server
/etc/ntp.client
/etc/rc2.d/xntpd [start|stop]
# Solaris 10
/etc/inet/ntp.server
/etc/inet/ntp.client

svcadm enable ntpd
/etc/ntp.conf (edit with ntp servers)
dateconfig (GUI)
chkconfig --list ntpd
chkconfig --level 2345 ntpd on
 
/sbin/service ntpd start
 
/etc/default/ntp
/etc/ntp.conf
/etc/init.d/ntp [start|stop|restart]
/etc/rc.config.d/netdaemons (set XNTPD to 1) 
/etc/ntp.conf
/etc/ntp.conf
startsrc -s xntpd
stopsrc -s xntpd

lslpp -L all|grep xntpd
ntp daemon options
/lib/svc/method/xntp
/etc/sysconfig/ntpd
/etc/default/ntp
/etc/rc.config.d/netdaemons
startsrc -s xntpd -a "-x"
/etc/rc.tcpip
NTP Trace commands
ntpq -p
ntptrace
ntpq -p
ntptrace
ntpq -p
ntptrace
ntpq -p
ntpdate (set the date)
ntpq -p
ntptrace
ntpdate

0 yorum:

Yorum Gönder