Hot answers tagged

131

Since the servers are physically next to each other, and you mentioned in the comments you have physical access to them, the fastest way would be to take the hard-drive out of the first computer, place it into the second, and transfer the files over the SATA connection.


67

netcat is great for situations like this where security is not an issue: # on destination machine, create listener on port 9999 nc -l 9999 > /path/to/outfile # on source machine, send to destination:9999 nc destination_host_or_ip 9999 < /dev/sda # or dd if=/dev/sda | nc destination_host_or_ip 9999 Note, if you are using dd from GNU coreutils, you ...


28

Do use fast compression. Whatever your transfer medium - especially for network or usb - you'll be working with data bursts for reads, caches, and writes, and these will not exactly be in sync. Besides the disk firmware, disk caches, and kernel/ram caches, if you can also employ the systems' CPUs in some way to concentrate the amount of data exchanged per ...


26

There are several limitations that could be limiting the transfer speed. There is inherent network overhead on a 1Gbps pipe. Usually, this reduces ACTUAL throughput to 900Mbps or less. Then you have to remember that this is bidirectional traffic and you should expect significantly less than 900Mbps down. Even though you're using a "new-ish router" are you ...


14

We deal with this regularly. The two main methods we tend to use are: SATA/eSATA/sneakernet Direct NFS mount, then local cp or rsync The first is dependent on whether the drive can be physically relocated. This is not always the case. The second works surprisingly well. Generally we max out a 1gbps connection rather easily with direct NFS mounts. You ...


12

First three octets in a MAC address uniquely identify the manufacturer of the device. Udev rules allow you to match any number of characters with an asterisk. Thus, you can write a generic rule that will match any device of a specific vendor: SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="74:2f:68*", NAME="wlan0" Alternatively, you can stop matching on ...


11

As you have the machine C on the internet, make a special account there named sesame, and on A you make an account with a public/private key from which you have copied the public key to the sesame account on C. You can now login from A to C, but instead of doing that you do: ssh -N -R 19930:localhost:22 sesame@yourserverC ( you might want to combine ...


9

In /etc/ssh/sshd_config add the following: AllowUsers remoteUserA@xx.xx.xx.xx remoteUserA@yy.yy.yy.yy userA AllowUsers remoteUserB@zz.zz.zz.zz userB Then restart the SSH daemon. You can use wildcards as described in Patterns section of the ssh_config manual.


8

You can use the smbclient program to give you an FTP-like interface to the Windows file share without having to isntall FTP on the Windows machine. Here follows some examples: Transfer file from local (unix/linux) to Windows: smbclient //server.domain.org/d$ <password> -W domain.org -U <my-user> -c "put file-local.xml folder1\folder2\file.xml"...


8

Congratulations, you've just delved into the concept of networking layers by realizing that ports and protocols are not directly connected with each other. As others are saying, telnet can be used to connect to any TCP port. However to understand why this is possible you need to understand a bit about networking layers. If you've ever heard of the OSI 7 ...


8

Yes, you can do this, and it's not even that hard. I have a laptop with a wireless card, and an ethernet port. I plugged a RapberryPi running Arch Linux into it, via a "crossover" ethernet cable. That's one special thing you might need - not all ethernet cards can do a machine-to-machine direct connection. The other tricky part is IP addressing. It's best ...


7

If you specify allow-hotplug eth0 instead of auto eth0 in /etc/network/interfaces, then the connection will only be initiated by udev when something triggers it, instead of at every boot. Hopefully that will be when another device is connected to the other end of your cable...


7

Install a IPv6 tunnel (such as Sixxs) on your Raspberry Pi. You'll now have a permanent static IPv6 address that will come online whenever your Pi is online. Make sure you secure your Pi as it's connected to the world now. If your B is connected to an IPv6 network, then connect directly to the Pi. If B is not connected to an IPv6 network, use C as a jump ...


7

The file is called /etc/hosts.deny, not host.deny Not all services use tcp-wrappers. sshd, for example, doesn't by default. Neither does apache. You can use iptables to block all packets from 117.25.128/24, e.g.: iptables -I INPUT -s 117.25.128.0/24 -j DROP Even better, you can use fail2ban to monitor a log file (such as apache's access.log and/or error....


6

If I understand your problem correctly, you want to ping your computer from another computer. The ping 1.2.3.4 works but the ping hostname doesn't. What I suspect the situation being is that your computer doesn't have a its hostname registered in DNS that is discoverable by the other machine. If the hostname is not known to the other machine it does not ...


6

I think this could work To disable eth0: ifconfig eth0 down To enable eth0: ifconfig eth0 up


6

TCP and UDP are two different protocols on top of IP. The TCP port number is part of the TCP protocol, and the UDP port number part of the UDP protocol. So yes, the two can be used simultaneously, as TCP and UDP are two different protocols, with different protocol numbers (see /etc/protocols). A DNS server can and does listen to both UDP/53 and TCP/53, at ...


6

You can use ifconfig -a or ip a l.


6

In addition to Tony´s answer, of querying OpenDNS, which I use in my scripts upon logging on to my servers to display both the local machine and remote public IP address: echo `hostname` `hostname -i` `dig +short +time=1 myip.opendns.com @resolver1.opendns.com` Google also offers a similar service. dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | ...


5

You cannot ping a normal NIC because NIC alone does not send any replies. Only a running computer is able send replies Normal network interface cards do not send any replies by themselves. They always need a running software on the computer to do so. When the CPU of the computer is powered down then there is no running software which would send a reply to ...


5

dumpcap, the low-level traffic capture program of Wireshark, can be instructed to stop capturing after certain conditions with the option -a. You can stop capturing after writing 60MB. This isn't the same thing as measuring traffic, since it depends on the file encoding, but it should be close enough for most purposes (and anyway the exact traffic depends at ...


5

OK, found it myself. The answer is /proc/sys/net/ipv4/conf/*/rp_filter. The option is documented at the Linux Foundation. While this is an old setting, it seems that Ubuntu changed the default value sometime between 07.04 and 14.04. Changing the value from 1 back to 0 fixed my problem.


5

telnet is a tool that can connect to any tcp port. By default, it connects to the telnet port (23), but you can tell it to connect to the http port (80) or smtp port (25) or whatever instead. You need to know how to "speak" the protocol that the remote server is listening for on that port, though. For example, if you want to get the headers of a web ...


5

Using netcat - no unneeded load on your CPU if you're not concerned about privacy (i.e. your home network is yours really) On your host, run cat /dev/sda | nc -n ipaddr 10000 where ipaddr is IP address of your PI On your PI, run nc -l 10000 >/dev/sdc All commands are to be run as root. OpenBSD netcat is assumed to be your nc version there (can be ...


5

A port is considered "in use" whenever there are any sockets bound to it. They don't have to be in LISTEN state, just bound. Therefore the TIME_WAIT sockets that you see do count. It gets a little bit more complicated if any sockets are bound to addresses and ports. Different sockets are allowed to be bound to the same port if they're bound to different ...


5

Under Linux, reading /sys/class/net/<interface>/tx_bytes and /sys/class/net/<interface>/rx_bytes (depending on which direction you're interested in) is a good way to get the counters for the number of bytes received and the number of bytes sent on an interface. The counters are also available together for all interfaces in /proc/net/dev but you ...


5

Resolvconf is pointing it out to a local software running in port 53 in the local machine. To find it out which one: sudo netstat -anlp | grep :53 As we have found out, it is the avahi daemon. To trace DNS resolution, also following command is useful: dig +trace www.cnn.com If you want to control your DNS setting yourself, specially in server cases (...


5

Background /proc and /sys filesystems are just a view of kernel structures, both filesystems reside in memory. Although both filesystems are writable (well, some of the files in there are writable) it is unwise to assume that they behave the same way as a real filesystems. Operations that allow you to write into a file inside /proc or /sys end as hooks ...


5

OpenVSwitch is a virtual switch. It works by attaching to several Ethernet devices in raw packet/Ethernet mode. It switches Ethernet frames between those Ethernet devices by reading/writing raw Ethernet frames to/from those network interfaces. This is nice if you want to switch between real Ethernet devices. If you want to connect a VM to your Open V Switch ...


4

add following line to /etc/network/interfaces : allow-hotplug eth0 Source:man interfaces lines beginning with "allow-" are used to identify interfaces that should be brought up automatically by various subsytems. This may be done using a command such as "ifup --allow=hotplug eth0 eth1", which will only bring up eth0 or eth1 if it is listed ...



Only top voted, non community-wiki answers of a minimum length are eligible