Hot answers tagged

100

Here's a one-liner I came up with for displaying request and response HTTP headers using tcpdump (which should work for your case too): sudo tcpdump -A -s 10240 'tcp port 4080 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^...........


46

As it says on the development page for jq "jq is written in C and has no runtime dependencies". So just download the file and put it in place with the following: wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 chmod +x ./jq cp jq /usr/bin


40

Any well-behaved device on an Ethernet LAN is free to ignore nearly any traffic, so PINGs, port scans, and the like are all unreliable. Devices are not, however, free to ignore ARP requests, afaik. Given that you specify you're scanning a local network, I find the least-fragile method of doing what you want is to try to connect to a remote address, then ...


29

As per the recommendation of MadHatter here. I will post my answer here as an addendum to the answers here so that it may be used in conjunction with the answers suggested here. Taken from the following website ## Install yum utils ## yum install yum-utils ## Package-cleanup set count as how many old kernels you want left ## package-cleanup --oldkernels -...


26

yum install -y epel-release yum install -y jq


25

Yes, you have to have an active RHEL subscription to download packages from RHEL's repositories. If your machine has never been subscribed, or the subscription is expired, you will not be able to use any of the repositories provided by RHEL. Red Hat states, in relevant part: If you choose to let all your subscriptions expire and have no other active ...


21

Put them in /etc/sysconfig/network-scripts/ifcfg-eth0, with a 2 or 3 etc. after them, such as: IPADDR2=192.0.2.48 NETMASK2=255.255.255.0 IPADDR3=192.0.2.49 NETMASK3=255.255.255.0 Unfortunately this seems to be undocumented (or I can't find it right now; it looks like Red Hat rearranged their web site yet again).


21

You can get something close to what you want by using -A, e.g. E....c@.@... .....Ng.d.P..Ch.).....s....... .A...u.BHEAD / HTTP/1.1 User-Agent: curl/7.29.0 Host: www.google.com Accept: */* Remember to use -s 0 to make sure you get the whole packet. Alternatively you could use wireshark to view the headers interactively.


21

READ. YOUR. CONFIGS. And when that fails... READ. ALL. OUTPUTS. Do you see what's in ifcfg-bond0? No, do you understand what's in ifcfg-bond0? What in the world of slippery penguins is miimmon=100? Oh I'm sorry, did you mean miimon=100? Yeah, I think you meant miimon and not miimmon. Also, a big giveaway is that when you restart your network service you see ...


20

From the TigerVNC manual. man Xvnc -SecurityTypes sec-types Specify which security schemes to use separated by commas. At present only "None" and "VncAuth" are supported. The default is "VncAuth" - note that if you want a server which does not require a password, you must set this parameter to "None". So -SecurityTypes None on the server is the ...


20

Since a device cannot ignore ARP requests, I like to use a tool named arp-scan. It is available in most repositories. When you run the command with the --localnet switch it will give you an overview of your entire internal network. sudo arp-scan --localnet Gives me a list of all IP -and MAC addresses on my network. It is also possible to specify a network ...


16

jq is in the EPEL repository, which you should already have enabled. Once you have enabled EPEL, you can just yum install jq like everything else.


15

An alternative is to add the CentOS repository to your yum configs. CentOS is in large part a derivative of RHEL. As such, most of its packages are compatible with RHEL. Michael Cutler wrote a guide for installing CentOS packages on RHEL. Briefly: # find out the release (version) of your RHEL # ex: 5.0, 6.0, 6.3 lsb_release -r cat /etc/issue # create a ...


14

Working on this question in Fedora 20. Have quick diagram of the files involved, as it might be useful to anyone who comes along.


13

The most reliable way when lsb_release is not installed is: # rpm -q --queryformat '%{VERSION}' redhat-release-server 6Server # rpm -q --queryformat '%{RELEASE}' redhat-release-server 6.4.0.4.el6 On minimal installs, lsb_release is missing. To get this working also with Red Hat clones (credit goes to comments): # rpm -q --queryformat '%{VERSION}' $(rpm -...


12

This functionality is provided by rpm, not yum: rpm -ql [packagename] From the documentation: The general form of an rpm query command is rpm {-q | --query} [PACKAGE_NAME] [query-options] Information selection options: -l, --list List files in package.


12

Push back... Red Hat Enterprise Linux doesn't work that way. Installing from source to meet audit requirements opens you to additional security issues and more management overhead. The approach Red Hat takes for its enterprise operating systems is to create a consistent target throughout the support lifecycle of the OS. Larger corporations and enterprise ...


12

Here's the schedule of tuned-adm configurations... I think it helps to see them in tabular form. The main thing to note is that the default RHEL6 settings suck!! The other thing is that the enterprise-storage and virtual-guest profiles are identical except for reduced swappiness on the virtual guest side (makes sense, right?). As for a recommendation on ...


11

I don't know which version of nmap you are running in your Red Hat 6.5, but for recent releases, the correct (and faster) way I think it would be: nmap -sn -n 172.16.128.0/25 This will list every host in your network (so, you could use any other IP from that subnet as it should be available). Edit and note: The subnet you mention is 255.255.255.128, but ...


10

The fix: Apparently, the Oracle installation on this system injected Oracle's path into LD_LIBRARY_PATH... [root@dev1v etc]# export declare -x LD_LIBRARY_PATH="/home/oracle/app/oracle/product/11.2.0/client_1/lib" Unsetting the variable allowed yum to function properly again.


10

There is no difference in them. Internally they do exactly the same thing: 1. reboot uses the shutdown command (with the -r switch). The shutdown command used to kill all the running processes, unmount all the file systems and finally tells the kernel to issue the ACPI power command. 2.init 6 tells the init process to shutdown all of the spawned ...


10

I would not recommend downgrading the distribution OpenSSH version shipped with RHEL6. There are dependencies that would potentially break your server. So no, it's probably not okay... We can possibly help you troubleshoot the client's scp issue, though. Have you run the SSH daemon in debug mode? Have you done the same with the client system?


9

If you don't have the xml for the running vm (eg. after transient migration), you can do virsh dumpxml vm_name > vm_name.xml virsh define vm_name.xml To check: virsh list --all --persistent The VM should now be listed. Or virsh dominfo vm_name There should be a line with 'Persistent: yes'.


9

Better than fighting with udev to force a device name for a given device, a permanent solution is to use UUIDs. This is valid for any device known to the device-mapper. This way, you don't have to worry if you add extra disks to your host. The UUID identifier guaranties that the right device will be used.


9

It's high because that saves effort. It takes effort to make memory free. And if you do that, it just takes effort to make it used again. So, to save effort, modern operating systems only make memory free if they have absolutely no other choice. If you're thinking "I want memory free now so I can use it later", banish that thought from your mind. Memory ...


9

init scripts are started in order as defined by the S## numbers. Newer versions of Unix (at least on Linux) start the same ## numbers in parallel (Although you can turn that feature off...) All you have to do it use a ## that's after the network and fsmount number. Then it should work. However, if the fsmount starts in the background, the easiest is probably ...


8

I had the same issue after installing Gitlab 6.4 on RHEL 6.5. No matter what i did i could not SSH using public keys for the main system user (git). Again the SSH keys were fine, as were the permissions on ~/.ssh (700) an ~/.ssh/authorized_keys (600). The issue was that seliunx was "enforcing" and the contexts in the .ssh directory were wrong, probably ...


8

rpm -ql packagename is roughly equivalent. You should think of yum as similar to apt-get and rpm as roughly equivalent to dpkg. yum deals with packages in terms of repositories, and rpm deals with individual packages. Ubuntu actually provides a cheat sheet on similar actions: Switching between RedHat and Ubuntu


8

Yes, the tool is called mock and it's in EPEL. Typical usage: rpmbuild -bs mypackage.spec mock -r epel-6-x86_64 mypackage-0.1-1.src.rpm This is actually the preferred way to build RPMs, precisely because it isolates the process from the system so that unexpected dependencies don't get pulled in. You can modify the files in /etc/mock to have it pull in ...


8

Don't do that ! Before you step outside the OS vendor's support structure you should verify that this is the right thing to do. Some PCI compliance tests will report that an application has vulnerabilities because it's reported version number is too low. This does not take into account backporting of security and bug fixes that many vendors employ. For ...


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