CiscoTik

Networking Administration

CiscoTik

Networking Administration

CiscoTik

آموزش شبکه های مبتنی بر سیسکو و میکروتیک و ...

طبقه بندی موضوعی
محبوب ترین مطالب
  • ۹۲/۱۲/۱۲
    eBGP
نویسندگان
  • ۱
  • ۰

بسیاری از مدیران شبکه برای سهولت  و ارتقای امنیت و یا به هزاران دلایل دیگه در کارهاشون باید از سیستم عامل های لینوکسی یا یونیکسی استفاده کنن.
در این مطلب لیستی از دستورات کاربردی لینوکس رو (با ذکر مثال کاربردی) قرار دادم که البته بصورت مرتب و دسته بندی شده هست.

دستورات ابتدایی :


#hostame - Displays the hostname and/or FQDN of the system
#uname -a - Displays the hostname and detailed kernel version
#cat /etc/redhat-release - Displays the version of Linux installed Example:
#cat /proc/cpuinfo - Displays information about the CPU(s)
#df -h - Displays the partitions, their sizes details, and mount points
#free - Displays detail about the system memory and usage
#lsof - Displays all open files
#lsof -nPi:22 - Displays any open files which use port 22
#locate httpd.conf - Displays the full path to any file named httpd.conf
#updatedb - Rebuilds index of files for search using the locate utility

دستوراتی برای رونوشت و تغییر جا و حذف کردن  و ...

#cp file1.txt file2.txt - Copies file1.txt to file2.txt
#mv old.txt new.txt - Renames a file called old.txt to new.txt
#rm file1.txt - Deletes file1.txt
#mkdir httpds - Creates a new directory called httpds
#cp -R httpd httpds - Recursively copies all files from directory httpd to httpds
#cp -PR httpd httpds - Recursively copies all files from directory httpd to httpds and retains all permission settings
#rm -rf httpd - Recursively deletes folder httpd and all contents
#chkconfig --list - Displays all services and their state (start or stop) at each runlevel
#chkconfig --level 35 httpd on - Sets httpd to start on runlevels 35 when machine is booted
#service httpd start - Immediately starts Apache
#find / -name "xxx "


تغییرات در ویژگی فایل ها

#chown apache virtualhosts.txt - Changes ownership of the virtualhosts.txt file to user apache
#chgrp apache virtualhosts.txt - Changes membership of the virtualhosts.txt file to group apache
#chmod a+x sniffer.pl - Allows the sniffer.pl file to be executed

CHMOD
7 rwx read, write, execute
6 rw- read, write
5 r-x read, execute
4 r-- read
3 -wx write, execute
2 -w- write
1 --x execute
0 --- no permissions


#chmod 777 passwords.txt - Allows read, write, and execute on the file passwords.txt to anyone
#chmod 000 passwords.txt - Blocks read, write, and execute on the file passwords.txt to anyone


دستورات مربوط به فایل های فشرده


#unzip package.zip - Unzips the file package.zip
#tar -zvxf stunnel.tar.gz - Decompressed a gzip file named stunnel.tar.gz


تغییرات در تنظیمات شبکه


#ifup eth0 - Enables network interface eth0
#ifdown eth0 - Disables network interface eth0
#vim /etc/network/interface
#/etc/init.d/networking restart


تنظیمات فایروال لینوکس

#service iptables status - Displays status of iptables (running or not)
#iptables -L - Displays ruleset of iptables
#iptables -I INPUT -p tcp -m tcp -s 192.168.15.254/26 --dport 22 -j ACCEPT - Accepts incoming

SSH connections from IP range 192.168.15.254/26
#iptables -I INPUT -p tcp -m tcp -s 0.0.0.0/0 --dport 22 -j DROP - Blocks SSH connections from everywhere else
#iptables -I INPUT -s "192.168.10.121" -j DROP - Drops all traffic from IP 192.168.10.121
#iptables -D INPUT -s "192.168.10.121" -j DROP - Removes previously allied drop all from IP 192.168.10.121
#iptables -I INPUT -s "192.168.10.0/24" -j DROP - Drops all traffic from IP range 192.168.10.0/24
#iptables -A INPUT -p tcp --dport 25 -j DROP - Blocks all traffic to TCP port 25
#iptables -A INPUT -p tcp --dport 25 -j ACCEPT - Allows all traffic to TCP port 25
#iptables -A INPUT -p udp --dport 53 -j DROP - Blocks all traffic to UDP port 53
#/etc/init.d/iptables save - Saves all IPtables rules and re-applies them after a reboot


مدیریت بروسه ها



#ps ax - Displays all running processes
#pgrep xxxx
#kill -9 (No. of proccess)
#ps aux - Displays all running processes including CPU and memory usage of each
#ps ax | wc -l - Displays the total number of processes
#top - Interactive process manager which allows sorting by criteria


مدیریت Log ها

#tail -f /var/log/messages - Displays the most current entries to the messages log in real-time
#tail -50 /var/log/messages - Displays the last 50 lines of the messages log
#head -50 /var/log/messages - Displays the first 50 lines of the messages log
#cat /var/log/messages - Displays the entire messages log
#cat /var/log/messages | grep "FTP session opened" - Displays any entries in the messages log that contain the ext FTP session opened
#cat /var/log/messages | grep "FTP session opened" > log2.txt - Writes any entries in the messages log that contain the ext FTP session opened to a file named log2.tx


باز کردن usb در لینوکس


1. Find what the drive is called

You'll need to know what the drive is called to mount it. To do that fire off:

sudo fdisk -l

You're looking for a partition that should look something like: /dev/sdb1. Remember what it's called.

2. Create a mount point

Create a new directory in /media so you can mount the drive onto the filesystem:

sudo  mkdir /media/usb

3. Mount!

sudo mount /dev/sdb1 /media/usb

When you're done, just fire off:

sudo umount /media/usb

نظرات (۰)

هیچ نظری هنوز ثبت نشده است

ارسال نظر

ارسال نظر آزاد است، اما اگر قبلا در بیان ثبت نام کرده اید می توانید ابتدا وارد شوید.
شما میتوانید از این تگهای html استفاده کنید:
<b> یا <strong>، <em> یا <i>، <u>، <strike> یا <s>، <sup>، <sub>، <blockquote>، <code>، <pre>، <hr>، <br>، <p>، <a href="" title="">، <span style="">، <div align="">
تجدید کد امنیتی