5
DNS tail -f bind.log rndc reload starts and stops the named daemon This zone is one that is auto updated by the dhcp process and those can't be just HUP'd. You must:  rndc stop rm *.jnl /usr/sbin/in.named (then restart) rndc reload nslookup –q=mx domainname.com does an MX record lookup on a doman view spf records: nslookup -q=TXT cisco.com MAIL /usr/lib/sendmail –bv [email protected] /usr/lib/sendmail –t –v to: subject: . interactive sendmail session. period on last empty line signals the session to start. /usr/lib/sendmail –bs shows version of sendmail makemap dbm access < access creates the access file from the text file. /etc/rc2.d/s88sendmail stop or start mailq –qR domainname.com lists all for that domain in the queue /usr/lib/sendmail –q –v

Useful Commands Unix

  • Upload
    t-siva

  • View
    221

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Useful Commands Unix

7/27/2019 Useful Commands Unix

http://slidepdf.com/reader/full/useful-commands-unix 1/5

DNS

tail -f bind.log

rndc reload

starts and stops the named daemon

This zone is one that is auto updated by the dhcp process and those can't be justHUP'd. You must: rndc stoprm *.jnl/usr/sbin/in.named (then restart)rndc reload

nslookup –q=mx domainname.comdoes an MX record lookup on a doman

view spf records:

nslookup -q=TXT cisco.com

MAIL

/usr/lib/sendmail –bv [email protected]

/usr/lib/sendmail –t –vto:subject:.

interactive sendmail session. period on last empty line signals the sessionto start.

/usr/lib/sendmail –bsshows version of sendmail

makemap dbm access < accesscreates the access file from the text file.

/etc/rc2.d/s88sendmail stop or start

mailq –qR domainname.comlists all for that domain in the queue

/usr/lib/sendmail –q –v

Page 2: Useful Commands Unix

7/27/2019 Useful Commands Unix

http://slidepdf.com/reader/full/useful-commands-unix 2/5

forces the queue to be processed.

telnet 203.xxx.xxx.xxx 25you should see a 220 responseHELO host.company.com (your mail server)

you should get a 250 responseMAIL FROM:[email protected] or in <[email protected]>you should get a 250 responseRCPT TO:[email protected] should get a 250 responseDATAyou should get a 354 responseSubject:testTest from me to you. (period on the next blank line)quit

you should get a 221 response

ps –ef |grep sendmailfind the process id.

kill –HUP pid for sendmail 

FTP

>bin sets it to binary>hash sets hash marks for files download and upload>mput file name or mget>quit

vi Editor 

:.S/text to replace /replacement text the “.” = current line

or use sedsed –e ‘s/old text/new text/g’ file.txt > newfile.txtex:sed -e 's/hw1aproposdba01/hwaproposdb/g' aliases > aliases.new

Page 3: Useful Commands Unix

7/27/2019 Useful Commands Unix

http://slidepdf.com/reader/full/useful-commands-unix 3/5

Unix System Commands

ifconfig –ashows the interface configuration

boot –Rreboots system

>FWDIR=/opt/cpfwl-41>export FWDIR

creates a system variable to point to a directory.

su –iinherits profile from currently logged in id.

vmstat (n) (n)

gives memory stats

shutdown –y –g0 i6 = reboot , i0 = eprom prompt, i5 = power off 

du –htotal size of all files in current directory megabytes or gigabytes. –k gives result in

kilobytes.

ls –sgives the size of each file.

ls -1p | grep -vc "/$"To count JUST files in immediate directory. The "/$" in the grep is looking for 

lines ending in /, which the -p flag of ls will put in for directories. The -v flag of the grepwill invert the search, so only lines NOT ending in / (i.e., all non directories) will belisted, and the -c of the grep means count.

Or 

ls -l | wc -l

UNIX Network Troubleshooting

this will give you some packet count, errors and collision info if any. errors, collisions may indicate afailing nic or cable.ifconfig -a will return nic id(s)

the fist display is totals then second samplesnetstat -I "interface?" 1 

Page 4: Useful Commands Unix

7/27/2019 Useful Commands Unix

http://slidepdf.com/reader/full/useful-commands-unix 4/5

 

hardware typerun the kstat without the "grep" "awk" then a bunch of attributes are displayed.

 example of kstat

Check the nic cekstat ce:0 | grep link_duplex | awk '{ print $2 }'

0= down1= half 2= full if a ce, bge, nxge, devicekstat ce:0 | grep link_speed | awk '{ print $2 }' if a eri qfe device

kstat eri:0 | grep ifspeed | awk '{ print $2 }' 

example of speed

kstat ce:0 | grep link_speed | awk '{ print $2 }'1000 

If the system as "lsof" on it -- we can look at port usage 

loop every 2 seconds at port queue.

while :donetstat -a|grep smtpsleep 2done

Local Address Remote Address Swind Send-Q Rwind Recv-Q State-------------------- -------------------- ----- ------ ----- ------ -----------localhost.63406 localhost.smtp 49152 0 49152 0 TIME_WAIT

*.smtp *.* 0 0 49152 0 LISTEN*.smtp *.* 0 0 49152 0 LISTEN*.smtp *.* 0 0 49152 0 LISTEN

eSafe

#./esgmenu

service esafe restartstop

Page 5: Useful Commands Unix

7/27/2019 Useful Commands Unix

http://slidepdf.com/reader/full/useful-commands-unix 5/5

start

XG 210 eSafe applianceThe management port on the back is eth0.Press (left) alt and F11 to get a prompt

Default root password is kn1TG7psLu

eSafe root password:

The default root password is kn1TG7psLu

The default password will work, unless the root password was changed whenconfiguring the HG200, then the password would be whatever you set it to.

I have included the document on how to change the passwords in eSafe, just in caseyou need it.

ftp://download:[email protected]/PDF/How_to_change_lost_password_in_eSafe.pdf 

to view conversations between eSafe server and recipients mail server:vi /opt/eSafe//esafe.ini

under [General] change log smtp traffic=0 to 1under [Debug] change debug level = 6

restart servicesservice esafe restart (service esafe ? – provides options)

the log is /var/esafe/log/eSafeCR/smtp_traffic.x.lognew log starts after 10mb

spool dir is /opt/eSafe/eSafeCR/spool

log files is /var/esafe/SessionLog

change default retry settings:vi esafe.ini located in /opt/eSafe

DefaultRetryInterval = 10 minutesMaxRetries = 6 outgoingIncomingMaxRetries = 36 incoming