General :: What Is Source / Destination Ports
Mar 9, 2011I want to know what is a source port and what is a destination port.
View 7 RepliesI want to know what is a source port and what is a destination port.
View 7 RepliesI am trying to run the same command(s) on the many destination servers from my source server.source server user "report" ssh keys are added to all destination hosts.
hosts.cfg:
----------
gadikota_dev01
[code]....
why do we have to define both Source/Destination AND Direction when building firewall.Isn't direction= source->destination? what would happen if source and destination were swapped?
View 3 Replies View RelatedTo make a full backup I run a live Knoppix DVD and clone the computer's HDD to an external HDD using the dd command. Is there a possible problem with the source being copied onto bad sectors on the destination disk? If so is there a way to prevent this from happening? A typical dd command I use looks like: dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror. Is this the recommended command for cloning to a disk of equal size?
View 1 Replies View RelatedI had a situation in which the the path of the file to be copied is written in other file and I had to copy it using shell script..I can use cp $(cat /home/robert/location.txt) /media/sda1 on normal linux shell...But I am using buildroot script where $(cat /home/robert/location.txt) evaluate to nothing..is just blank..
View 1 Replies View RelatedWhen you run the following cp command in the BASH terminal, how does Linux know which files are the source and which are the destination when copying multiple files from one location to another?How does Linux know that the services, motd, fstab, and hosts files are the source and the /home/fred/my_dir is the destination?This question came up in a Linux class and I was not sure of the answer. I was thinking it is based on the source path entered ending with a file path and the destination being a directory, but was not sure.
View 4 Replies View RelatedWhich of these (if any) are correct?
cp -r /var/www/vhosts/niftyfiftyparty.com/httpdocs/sites/all/modules/*.* /var/www/vhosts/keylargodivecenter.com/httpdocs/sites/all/modules/*
in /var/www/vhosts/niftyfiftyparty.com/httpdocs/sites/all/modules/
cp -r *.* /var/www/vhosts/keylargodivecenter.com/httpdocs/sites/all/modules/*
in /var/www/vhosts/keylargodivecenter.com/httpdocs/sites/all/modules/
cp -r /var/www/vhosts/niftyfiftyparty.com/httpdocs/sites/all/modules/*.* *
Both the source and destination folders are valid. There are several folders in the niftyfiftyparty modules folder that I need in the other one.
Using iptables is there a way to switch the destination IP to become the new source IP and forward that connection.iptables store the src and dst IP in a variable for a particular connection?
View 2 Replies View Relatedi want to copy one or more files or directory from one drive to multiple drive simultaneously. It like a cloning a disk. But i dont like clone entire disk. i want to copy/clone only certine files or folder. if any one can know how to copy one source to multiple destination simultaneously.
View 3 Replies View RelatedI have six .iso files of CentOS 5.5 (I believe it is a distro of Linux) in a removable External HDD and I want to combine the six files to an only iso. I searched on the Internet and found a script named mkdvdiso.sh and the syntax of that script is: ./mkdvdiso.sh /source /destination/DVD.iso However, I don't know what I can replace the two parameters "source" and "destination" with. I have tried everything I can but it's useless.
View 11 Replies View RelatedI'm simply trying to make a little restriction on www packets under two rules:
1. Allow inbound/outbound www packets (works!)
2. DROP inbound traffic to port 80 from source ports less than 1024. (DOES NOT WORK!)
Now, technically, when i use hping to test my rules, hping3 192.168.100.100 -S -p80 -s 1023 I should NOT receive any packets. However, i still receive packets, which means my rule that says less than 1024 does not work. (see below)
And this is my iptables rules in shell-script so far:
#!/bin/sh
DEFAULT_NIC=eth0
SERVER_IP="192.168.100.100"
ALLOWED_WWW_PORT=80
IPT="/sbin/iptables"
[Code].....
When I use the cp or mv command to copy/move files is there a way for me to have the destination file assume the same name of the source file, however add an additional suffix.
For example
Code:
Now what if I wanted this...
Code:
Do I have to type the destination file out manually everytime? or is there a quick way for the cp or mv command to assume the source file name and add the .bak
Let us assume I have a zip file called patch.zip, when I run unzip -l patch.zip I get the following output.
bin/a
bin/b
lib/c
To this zip file I want to add a new file, "Readme.txt" located at /path/to/Readme.txt in such a way that, when I re-run unzip -l patch.zip again I get something like this
bin/a
bin/b
lib/c
doc/Readme.txt
how do I gunzip to a destination directory other than the current one?
this did not work:
gunzip *.gz /putthemhere/
We used to send files in the form of .jpg, .tif, and/or .pdf. Normally the file name will be in the form of 08072011IE01CTYHUB.PDF (DDMMYYYY - is the date, IE - publication, 01 - page number, CTY - edition name and HUB - destination in three characters). These files will be stored in a common folder (say SOURCE). I need a script to move these files to destination by reading the destination from the file name through FTP. At destination these files should be moved to a folder meant for CTY. Please note before the file is sent through FTP it should be compressed (zipped) At SOURCE folder the files will be as:
08072011IE01CTYHUB.pdf
08072011IE01CTYSMG.pdf
08072011IEdavanamCTYHUB.pdf
08072011IEversaVANSMG.tif
etc. where first 8 characters are date in the form of DDMMYYYY, next 2 characters are publication, last 3 characters are destination, previous 3 characters are edition and left over in the middle are page number in the form of NN or name. Presently I am zipping these files and send it through FTP to the destination. At destination my counterpart takes the file, stores in appropriate location (like folder name CTY) for use. To automate the above process, I want a script.
I am performing a dry run using Rsync on 2 different boxes.While i'm doing that, Under destination directory, I want a specific directory x to be ignored for sync.Please let me know the exact pattern to ignore the directory.The current command I'm using is:rsync -avnc --delete $LOCAL_DIR $USERNAME@$DESTINATION_IP:$REMOTE_DIRunder DESTINATION_IP, I would want to ignore a particular directory under REMOTE_DIR.
View 1 Replies View RelatedI'm trying to install Slackware package into some specific locations, like for example, I want to put Linux base package into at / and put applications on /usr/local. However when I'm installing using "setup" program, I cannot find a part that let me to choose the installation destination.
At "setup install" option, it gives six different installation method like full, newbie, menu, expert, custom, and tag path. But none of them (I cannot find it) gives an option where to put the installation package to.
Suppose I have a tree structure like this:
/home/mahmood/sim/a/b/file1.cpp
/home/mahmood/sim/a/b/file2.h
/home/mahmood/sim/a/c/file3.txt
/home/mahmood/sim/d/file4.txt
How can I copy all of them to /home/mahmood/sim. So that when I run "ls" in /home/mahmood/sim, I see all files:
file1.cpp
file2.h
file3.txt
file4.txt
Can 'cp' search for all file and copy them in another folder?
I have recently purchased an external hard drive in order to backup my home partition. In my PC I have a "1.5T" drive with several partitions on it, containing OSes and the home partition. The home partition is 1.3T according to df, the external drive contains one partition that spans the entire disk,df reports it as 1.4T in size. Both partitions are ext3. When I use rsync to copy files from the home partition to the external partition, the external disk becomes full, despite the destination - supposedly - being larger than the source. I don't understand why copying files from one partition to a slightly bigger partition should need more space than on the source partition. Does anyone know what is happening ?
Details : I created the partition on the external drive with gparted; gparted reported it the already have several gigabytes in used space immediately after the partitions creation - I thought at the time that this must be normal. The home partition contains many files of all sorts, including lots of big audio and video files. If you are wondering, for all my important files this external disk is only secondary backup, as they are also backed up to the "internet".
These are the mount points :
/mnt/tmp/ : home partition, /dev/sdb6
/mnt/external/ : external partition, /dev/sdc1
I used rsync to copy the files, I know there are more efficient ways to do this, but I wanted to use the same command that I will subsequently run to sync the backup.
rsync -av --progress --stats --recursive --perms --links --delete /mnt/tmp/ /mnt/external/
Next I tried adding the --sparse switch, as I was wondering if the problem may come form sparse files. I don't know however if rsync would go back and shrink the sparse file by just adding the switch and executing the command. I also added --one-file-system, for good measure. Here is what I ran next :
rsync -av --progress --stats --sparse --one-file-system --recursive --perms --links --delete /mnt/tmp/ /mnt/external/
I tried an fsck on the home partition :
fsck -f /dev/sdb6
This is the output from the last rsync :
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "abcd.avi": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.6]
[code]....
Looking at the destination after a partial copy seems to indicate that the problem is not symbolic links being "expanded". I have not checked the source filesystem for sparse files, nor the destination to see if these files could be larger there, as this does not seem trivial.
Here is some additional info :
$ df /mnt/tmp/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb6 1415342836 1414173740 369096 100% /mnt/tmp
[code]....
We have an rsync cron job set up to mirror all the files in a "..dashtdocsdocs" folder to the same folder on another server. It copies all the files over correctly and deletes any files in the "docs" directory that aren't in the sending directory, but it also deletes any files we put in the target directory's parent folder (..dashtdocs or other subfolders like ..dashtdocsimages) even though they've been excluded in the .rsync-filter file.
Here's our current rsync .sh:
/usr/local/bin/rsync --stats -qPzrtpl --delete --password-file=/var/run/.appprodrsync --log-file=/export/home
/webuser/logs/rsync-extranet-log -FF /export/home/ appprodrsync@appprod::dprweb_extranet/ > /export/home/webuser/logs/rsync-extranet-output 2>&1
[code]....
So for example server A has ..dashtdocsdocs and ..dashtdocsimages. Server B has ..dashtdocsdocs but if I manually copy the images folder over to ..dashtdocsimages, the images folder gets deleted from the target directory every time rsync runs.
A: ..dashtdocsdocs
..dashtdocsimages
B: ..dashtdocsdocs
..dashtdocsimages (<-- gets deleted everytime rsync runs)
I'd like to keep just the docs directory synched and update other folders manually, but they keep getting deleted. It looks to me like it's running a delete-excluded option, but that option wasn't used.
I cannot access/ping my Debian server. I know the IP is right (ifconfig, route and ip addr) all gave me 10.0.2.25 (route gave me 10.0.2.0).I cannot ping it from any computer in my netwerk, even when I try to ping it from my Debian itself, it gives me Destination Host Unreachable !(Wierdly, I can ping 10.0.2.2 tho).I am using virtualbox when the netwerk options 'NAT' turned on. When I look at my /etc/network/interfaces/ the last line looks like:iface eth0 inet dhcpShouldn't their be some other stuff listed?
View 6 Replies View RelatedToday i am trying to learn how to use sed. I set up a testing folder with the following files:
AAb.lol
AAc.lol
AAx.lol
test.sh
My goal is to create a script (test.sh) which renames all the files to their original name without AA. I want to end up with this:
b.lol
c.lol
x.lol
test.sh
sed seemed to be the perfect tool so i went ahead and created a script which i think should clear the job.
[Code].........
mv: missing destination file operand after `$i' From that 2nd line i can tell that $NewName is just empty. I also read something about sed needing the -e option for scripting purposes but i just don't understand it.
I'm writting an app for desktop and embedded linux and I need to get information about the multiserial port, and I need to know which port is been used (by a printer, por example).The multiserial I'm using is an Altera Corporation Device 0004, and I just need to tell how many ports are there and how many is been used.
View 3 Replies View RelatedMany years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.
View 2 Replies View RelatedI have the following content on the source directory:
source/foo.txt
source/bar/another_file.txt
source/bar2/and_another.txt
I want copy those files to a destination directory which, after copy, shall look like this:
destination/foo.txt
destination/another_file.txt
destination/and_another.txt
How can I do this? It seems that "cp" lacks such an option
On Debian Standard System I would like to is change /tmp directory from it's original /dev/hda8 to destination /dev/hdd5
Code:
Disk /dev/hda: 6448 MB, 6448619520 bytes
255 heads, 63 sectors/track, 784 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
[code]...
If I change /dev/hda8 to /dev/hdd5 and reboot the startx command fails to run.
How can I tell if my USB ports are 2.0 ports?
View 1 Replies View RelatedI have just been bothered by a fairly small issue for some time now. I am trying to search (using find -name) for some .jpg files recursively. This is a Redhat environment with bash.
I get this job done though I need to copy ALL of them and put them in a separate folder BUT I also need to keep the order intact after copying.
For e.g - If I get a JPG file under /home/usr/new/1/ then the destination also needs to be /test/old/new/1/.
At the moment, I am simply putting all files under /test/old/ and I can't somehow get the later /new/1/ folder path created under /test/old/
I understand this could well be done using while OR if else loop, though if someone can just guide me with a hint, I would be really grateful.
I will complete the rest of the steps and was asking here since I am still not comfortable with the shell/bash scripts yet and planning to be really good at it over the next couple of months.
I'm working on a Linux (fedora) based arcade dance machine using a game called Stepmania. I've got it all up and running and i'm trying to get it to work with two dance pads.
It detects the dance pads fine and they work well, the only issue is that when the machine is turned on it seems to randomly pick which pad is /dev/input/js0 and which is /dev/input/js1
What this leads to is the pad on the left controlling the character on the right & vice-versa. So I was wondering if there is any way to tie or map the joystick to a particular USB port so they always stay where they should ? Or is there another way this could be accomplished ?
I want to configure following serivices on non-standard (or not well-known)port uisng RED-HAT LINUX INETD: TELNET, SSH, SNMP, FTP
1) Is there any issue/limitation doing this?
2) Any caveat or peculiarities related to any of the services?