Hot answers tagged

13

I doubt we'll ever be able to tell you where it went, but you should just be able to reinstall it using yum. yum reinstall man yum doesn't check to see if files exist when you run yum install, it just checks a database of which packages have been installed. If someone deletes all the files outside of the package manager, it won't know (you can get it to ...


6

Red Hat Linux 9 was released in 2003, and discontinued in 2004. There is no direct CentOS equivalent; CentOS 2, the first release, was based on Red Hat Enterprise Linux 2, and is the closest release to Red Hat Linux 9 chronologically. All these versions are over a decade old though, so you'd be better off using the latest release of CentOS, or even Red Hat ...


6

resize2fs probably didn't finish the job, but you can't tell because you missed the end of its output. You should not have gone ahead and executed lvreduce at that point. There is a very good chance that this corrupted part of your filesystem. Note that you cannot undo this operation by running lvextend and hoping that the lost bytes come back and that the ...


5

Here's the rules you're looking for: iptables -A INPUT -p tcp -s 202.54.20.22 --sport 5000 -j DROP iptables -A OUTPUT -p tcp -d 202.54.20.22 --dport 5000 -j DROP If the service sends UDP packets, you have to change -p tcp with -p udp.


4

With RHEL 7 / CentOS 7, firewalld was introduced to manage iptables. IMHO, firewalld is more suited for workstations than for server environments. It is possible to go back to a more classic iptables setup. First, stop and mask the firewalld service: systemctl stop firewalld systemctl mask firewalld Then, install the iptables-services package: yum ...


3

No. The mount options trump all. That's what they're for: to ensure that nothing ever gets executed directly from that filesystem. To counter noexec, you can run most programs indirectly by invoking their launcher: If the program is a script (starting with a shebang), invoke the interpreter and pass it the script as its first argument. If the program is a ...


2

As is often the case on Solaris, /usr/bin/egrep is a legacy implementation that isn't POSIX-compliant, while /usr/xpg4/bin/egrep is a POSIX-compliant implementation and has little if anything beyond POSIX. Unless you're running legacy Solaris applications from the pre-POSIX days, make sure that /usr/xpg4/bin is before /usr/bin in your $PATH. GNU tools ...


2

Blocking USB devices based on various attributes (including the class and/or protocol) or even conditions (e.g. "if this device is connected, then" or "if the local time is in this range, then") is possible using USBGuard. Here's an example rule that blocks a specific class of USB devices: block with-interface one-of { 02:*:* e0:*:* } The rule will block ...


2

You're on the right track with tty, and the -t option gives you just that. However, unless you are actually aiming to get a tty session for interacting, leave this option off of the last ssh command in your chain. In your case you just need it on the first connection: ssh -L 5901:localhost:6000 host1 -t ssh -L 6000:localhost:5901 -N host2 Now when you use ...


2

The dhclient-script is doing this. It checks to see what nameservers and domains are visible. Sometimes that is useful. According to its manual page, When it starts, the client script first defines a shell function, make_resolv_conf , which is later used to create the /etc/resolv.conf file. To override the default behaviour, redefine this function in ...


2

You've created a volume — an empty space where information can be stored. You can't mount it, because what gets mounted is a filesystem — a structure for information. Mounting makes a filesystem visible in a directory. Use the appropriate mkfs command to create a filesystem on the volume, e.g. to create an ext4 filesystem (the de facto standard on Linux) ...


2

You can use bash globbing to match multiple folders. Something like: rm ./Folder/*/Log/* Or maybe even better: rm ./Folder/Sub*/Log/* The second one will remove all the files inside the Log directory inside a directory that starts with Sub. You can add -r (recursive) or -f (force) to your rm command if needed. For more on bash globbing, you can see ...


1

For deleting redirection line try to use this one, file_line {'remove_kiwi_forward2': ensure => absent, match_for_absence => true, path => $confFile, match => '^.*50$', line => '\*.err;\*.emerg;\*.alert;\*.warning;\*.debug;\*.notice;\*.crit;\*.info.*@10.19.24.50', notify => Service[$serviceName], }


1

You need to edit /etc/modprobe.conf to load bonding module: vi /etc/modprobe.conf add following lines alias bond0 bonding alias bond1 bonding Configure your ethernet interfaces ( 4 configuration files) vi /etc/sysconfig/network-scripts/ifcfg-ethX like the following example: DEVICE=ethX USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none ...


1

I would suggest using autofs to mount the NFS share. When your NFS server isn't reachable, it won't be able to automount the volume.


1

Determine the path in which the user is attempting to launch the bin file # this will output the path the user is in actually # and you can use this aswell as a variable. echo $PWD # This will search the whole filesystem for your file # in case you need this rather than the patch the user is in. # you can aswell make this a variable to put the whole ...


1

The changes to iptables can't be rolled back one by one: you have to reset all the rules and re-apply the ones you need. In your case, you seem to have a clean firewall by default, so all you need to do is: sudo iptables --table nat ---flush This will remove all the rules from the "nat" table.


1

add to /etc/auto.master /var/autofs/removable /etc/auto.removable --timeout=2 add to /etc/auto.removable theDiskLabel -fstype=ext4,rw,gid=1000,umask=002 :/dev/disk/by-uuid/thediskid restart autofs service sudo service autofs restart Access your directory, thats it! cd /var/autofs/removable/theDiskLabel



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