Page is a not externally linkable
satanclaus - 4:40 pm on Jan 30, 2002 (gmt 0)
(Linux Backup Information) tar -ztvf (filename) view tarbalsl tar -ztvf (filename) >> filename (will create a file to view contents of tarball) tar -ztvf ".tar.gz" ¦ grep "filename" (this will search the tarball) tar -zxvf (.tar.gz only!) file.tar.gz /path (by default it will unzip to (Linux Commands) wall "message" -- send a message to everybody's terminal (broadcasting a message to all) dd if=ntbootdisk.img of=/dev/fd0 bs=512 (this will read the image ntbootdisk.img and copy it too the file) dd if=/dev/hda1 of=/mnt/harddrive (this will take the drive /dev/hda1 and copy it to the image /mnt/harddrive) kill or killall -9 process (will kill the process) find / -name 'tacos' (will start from root / and search for file named tacos) df -h (check disk space on all mounted harddrives) fdisk / cfdisk (create and view partition tables) date -s 'Sat Feb 10 02:59 PST 2001' (setting time on linux machine) mount -t smbfs -o username=user,passwd=password //server/share /mnt rm -rf (remove directory and files stored in directory) elm -f (/var/mail/spool view and read emails) uname -a (show current kernel version) sendmail -bt -d0 (info on sendmail version and more) whereis, locate, and find are all search commands fg (fore ground) when running a task and using crtl-z to exit that task jobs - list all jobs running in foreground ps -aux ( show all processes that are being ran on this system) ## restarting sendmail hashes files as needed. (even aliases) makemap hash mailertable < mailertable (run in the /etc/mail directory sendmail -bi (run this commands to refresh the /etc/mail/aliases and sendmail -q (this command will process all files in the sendmail queue) mount /dev/sdb1 /mnt/backup (this will mount the second SCSI drive that tar -xvf extract .tar files tar -cvf %name% /directories who - show all users logged in last - show the last users logged in ( use last - number to shorten) talk - used to talk with other users on the system chown - change the current ownership of a file or folder chmod - change the file attributes on a system chgrp - change group ownership of a file or folder mkdir - make a directory rm - remove a file rmdir - remove a directory ln -sf creates a symbolic link to a folder ln -sf test /home now you would be able to change to test and it would link to /home ln -s filename youname (create a symbolic link to a file) e2fsck ( use to fix problems with ext2 drives) fdisk (use to partition a harddrive) mkfs.ext2 ( use after creating a partition with fdisk) (SAMBA) Samba is used to allow Windows Clients to access stuff likes /home # here is a list of problems and resolutions that I've found with Samba - IPC$ password is being requested on Windows clients - - Cannot print even though it can connect and view properties. Samba contains 3 primary sections by default: [global] (VNCSERVER) logon as the user you wish to start vncserver for: 1> Before connected assign your Xserver a display. Simple just type 2> On the Windows Client you will enter the number as host:number. # You may only be able to connect as root. This can be fixed by adding # you will also need to have the following path statement in .bash_profile # Changing you Session manager can be done by editing Xstartup file in (IPChains) # utility that works ! [pointman.org...] PMFirewall ! # simple ip chains setup (remember to MASQ first then set "filters") Key: > eth0 (internal network) 192.168.1.0/24 ! ipchains -R "output/input/or/forward" 1 (number goes here) ! ipchains -F input (flush all input commands) # MASQ # ipchains filters # prevent all ipaddresses from 127.0.0.0/8 from entering machine. # filter by ip address x is the ipaddress you want to block ! ipchains -A input -j DENY -p all -l -s x.x.x.x/x -d 0.0.0.0/0 # filter by port number deny access to port for y.y.y.y machines ! ipchains -A input -j DENY -p tcp -l -s 0.0.0.0/0 -d y.y.y.y/32 port # port redirection # ip accounting ! ipchains -L chain -v # adding routing on startup (Cron Daemon) * Cron is a task schedule that looks in /etc/cron.hourly,daily,weekly,monthly. > crontab /etc/crontab 05 = minute /sbin/shutdown -r now = command ** = everyday if this file where used as jplane crontab -u jplane jplane.ct this would save the crontab as jplane.ct ( Sendmail ) sendmail -q will force sendmail to push all the information in the /var/spool/mqueue out! Relaying Relaying denied? - check you access file and restart sendmail Make sure you stop and start sendmail after this and also recreate the .db file (makemap hash access > access Sendmail old and new filenew support old filename new filename /etc/bitdomain /etc/mail/bitdomain /etc/aliaes /etc/mail/aliases /etc/sendmail.cw /etc/mail/local-host-names /etc/sendmail.ct /etc/mail/trusted-users /etc/sendmail.oE /etc/mail/error-header /etc/sendmail.hf /etc/mail/helpfile /etc/services.switch /etc/mail/service.switch /etc/sendmail.st /etc/mail/statistics #Configure access to allow relaying for certain hosts. access # Contains all the aliases for usmicro.com aliases # not being used provided for domain name mappings. User of this should domaintable # contain a list of domains which we hosts. Formally known as # Files contains addresses for customer email addresses to local over # Used in addition to aliases # sendmail configuration file # using the same as mailertable (maps incoming users) maps all virtual address into real addresses # add user@domain.com localhost here for routing virtusertable Info: ## New Domains with email! 1> Setup the proper configuration in /var/named/missing.com 5> Add users to virtusertable (5.1 called maildomains) jannie@missing.com jannie then save and run makemap hash virtusertable < virtusertable 6> Also add the same above entries to mailertable save and run makemap Once all these steps have been completed also restart sendmail with (Apache) Creating several websites to connect to one ip address. (NFS) add hosts names to /etc/exports - restart system
*deep breath*
you path) example $PWD (current path) /home/jplane> tar -zxvf cool.tar.gz
will do this /home/jplane/cool>
---------------------------------------------------------------------------
run fg to move between applications.
ps -aux ¦ grep %file% (search for a process that is running)
this will refresh the .db table)
/etc/mail/majordomo.aliases files)
contains all the backup files and folders"/data & /config"
tar -cvf archive .tar files
tar -zxvf extract .tar.gz files
tar -zcvf compress .tar.gz files
tar -cvf -X %name% /directories
directories and printers.
check > smbpasswd -a %username% (add user for samba, will need to also be in /passwd)
check > smbpasswd %username% (change the password for samba users)
check > security = share or user (set this to share)
check > permissions for spool directory (/etc/printcap)
check > spool path
check > restart lpd
- Password is being requested for printing
check >
[printers]
guest ok = yes
workgroup = (windows workgroup)
server string = (name)
printing = lprng
[homes]
comment = (windows comment)
path = /home
writable = yes
guest ok = yes
[printers]
comments =
path = (spool path)
printable = yes
browseable = yes
guest ok = yes
[jplane@proxy jplane]$ vncserver (this will start the vncserver for
"jplane" and will assign you a number to your host. It will display this
number once you start the vncserver.
vncpasswd and then it will ask you for a password.
Example I started the Vncserver and was assigned number 10. I would
connect to 64.64.222.4:10.
full permissions to /tmp/.X11-unix directory.
# Also it is recommend to connect to a VNCserver you have a connection of
10+ Mbps at least.
> PATH=/usr/local/bin:/usr/local/sbin:$PATH:$HOME/bin
/home/user/.vnc/Xstartup
gnome-session
twm &
kde &
startkde &
# MASQ aka NAT
A = append
D = delete
j = rule
s = source
d = destination
L = list
F = flush
R = replace
Z = zero counters to all chains
C = test this packet on chain
N = create a new user defined chain
X = delete a user defined chain
X = list current masquerading connections
p = proto by number or name
s = source
m = number to mark on matching packet
l = turn on logging
v = verbose mode
V = version
> adds rule
! ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0.0.0.0/0
> delete rule
! ipchains -D forward -j MASQ -s 192.168.1.0/24 -d 0.0.0.0/0
or delete by using
! ipchains -F output (flush all output commands)
! ipchains -F forward (flush al forward commands)
! echo "1" > /proc/sys/net/ipv4/ip_forward
! ipchains -P forward DENY
! ipchains -A forward -j MASQ -s x.x.x.x/24 -d 0.0.0.0/0
! ipchains -A input -j DENY -p all -l -s 127.0.0.0/8 -i eth0 -d 0.0.0.0/0
! ipchains -A input -j DENY -p all -l -s 127.0.0.0/8 -i eth1 -d 0.0.0.0/0
! ipchains -A input -j DENY -p tcp -l -s x.x.x.x/x -d y.y.y.y/32 10:100
! ipchains -A input -j REDIRECT 8080 -p tcp -s 0.0.0.0/0 -d 0.0.0.0/80
! ipchains -N acctin
! ipchains -N acctout
! ipchains -N acctio
> create a script that will start the above rules
> add the following lines to /etc/rc.d/rc.sysinit
if [ -f /sbin/ipchains ] ; then
/route/./start_route
echo Router is now starting.
fi
* Crond is the daemon that runs in the background.
* /etc/crontab is the conf file that contains all the info to run jobs and when.
- u username displays the users jobs running
- l displays the current job
- r remove a job
! format of a cron job
05 15 01 01 01 /sbin/shutdown -r now
15 = hour
01 = day of the month
01 = month
01 = day of the week
sendmail relaying is controlled with /etc/mail/access and through /etc/sendmail.cf
example of access file
localhost RELAY
nicepeople.com RELAY
/etc/domaintable /etc/mail/domaintable
/etc/genericstable /etc/mail/genericstable
/etc/uudomain /etc/mail/uudomain
/etc/virtusertable /etc/mail/virtusertable
/etc/userdb /etc/mail/userdb
/etc/sendmail/aliases /etc/mail/aliases
/etc/ucbmail/aliases /etc/mail/aliases
/usr/admn/sendmail/aliases /etc/mail/aliases
/usr/lib/aliases /etc/mail/aliases
/usr/ucblib/aliases /etc/mail/aliases
/etc/mail/sendmail.cw /etc/mail/local-host-names
/etc/sendmail/sendmail.cw /etc/mail/local-host-names
/etc/mail/sendmail.hf /etc/mail/helpfile
/usr/ucblib/sendmail.hf /etc/mail/helpfile
/etc/ucbmail/sendmail.hf /etc/mail/helpfile
/usr/lib/sendmail.hf /etc/mail/helpfile
/usr/share/lib/sendmail.hf /etc/mail/helpfile
/usr/share/misc/sendmail.hf /etc/mail/helpfile
/share/misc/sendmail.hf /etc/mail/helpfile
/etc/mail/sendmail.st /etc/mail/statistics
/etc/mailer/sendmail.st /etc/mail/statistics
/etc/sendmail/sendmail.st /etc/mail/statistics
/usr/lib/sendmail.st /etc/mail/statistics
/usr/ucblib/sendmail.st /etc/mail/statistics
access.db
aliases.db
really be limited to your own domains. It may be useful if you change
names.
domaintable.db
/etc/sendmail.cw
local-host-names
riding domains
mailertable
mailertable.db
majordomo.aliases
majordomo.aliases.db
sendmail.mc
virtusertable.db
Remember to create DB you must use makemap hash file < file this will
generate a .db file that is binary format.
2> Configure Users janedoe and johndoe
3> Add missing.com to /etc/mail/local-host-names (5.1 called sendmail.cw)
4> Add Johndoe and Janedoe to /etc/mail/aliases:
johnny@missing.com johnny
also (not necessarily, only need to add the virtusertable)
sendmail -bi command or /etc/rc.d/init.d/./sendmail restart
Create the VirtualHost tabs in /etc/httpd/conf/httpd.conf and specify the
Apache Webserver that is running the ip address.
/etc/exports
/ (mount point) 10.0.0.17/255.255.255.0(rw) (this will mount 10.0.0.17 and allow read/write access)
access drive from client by typing
mount -o wsize,rsize server:/ /mnt
(note: rpc and portmap both need to being running, check status using netstat -na)