Questions tagged [centos7]

CentOS 7 reached end of life on June 30, 2024.

https://www.redhat.com/en/topics/linux/centos-linux-eol

CentOS was a Linux distribution standing for "Community ENTerprise Operating System" and is a rebuild of "Red Hat Enterprise Linux" (RHEL), belonging to the same company that distributes RHEL (Red Hat, Inc.). The "CentOS7" tag refers to versions 7.x-xxxx of CentOS, working only on 64-bit hardware.

2973 questions
87
votes
2 answers

How to open port for a specific IP address with firewall-cmd on CentOS?

I would like to open port 4567 for the IP address 1.2.3.4 with the firewall-cmd command on a CentOS 7.1 server. How can I achieve this, as the documentation I could find was too specific on this?
Michaël Perrin
  • 973
  • 1
  • 7
  • 7
81
votes
6 answers

Centos 7 save iptables settings

Problem: iptables resets to default settings after server reboot. I'm trying to set rule like this: iptables -I INPUT -p tcp --dport 3000 -j ACCEPT after that I do: service iptables save and it writes back something like this iptables: Saving…
78
votes
2 answers

Create a directory under /var/run at boot

I had a daemon that needed its own dir in /var/run for its PID file with write permission granted to the daemon's user. I found I could create this dir with these commands: # mkdir /var/run/mydaemon Then I could change its ownership to the…
user24601
  • 1,043
72
votes
6 answers

Could not resolve host: mirrorlist.centos.org Centos 7

If you are reading this after 2024 mirrorlist.centos.org doesn't exist anymore. As noted by @user202729 in notes check this reply. I have a fresh install of latest centos 7 [root@localhost ~]# cat /etc/centos-release CentOS Linux release 7.4.1708…
68
votes
13 answers

Install a newer version of Git on CentOS 7

I like to enable Git "Push to Deploy" on my CentOS 7 server. Currently I only can get Git 1.8.3.1 via yum. I need a newer version. Do I have to build it from source or is there any repo I can use? I alreay added EPEL and elrepo but yum still gives…
Oliver
  • 791
67
votes
4 answers

How to manage DNS in NetworkManager via console (nmcli)?

I have CentOS 7.2 (guest in VirtualBox, vagrant box centos/7, no GUI). I see there is a nameserver in file: $ cat /etc/resolv.conf # Generated by NetworkManager nameserver 10.0.2.3 But how to add or replace with new one? I have done this manually…
Kirby
  • 1,139
45
votes
4 answers

Authentication is required to manage system services or units.

I have a strange issue whenever trying to stop/start a daemon as a regular user, it asks to authenticate with the credentials of another regular user - for example: [bob@server ~]$ systemctl stop some-daemon.service ==== AUTHENTICATING FOR…
45
votes
5 answers

How to shrink /home and add more space on CentOS7

CentOS 7 file system is XFS, And resize2fs doesn't work. I need to shrink /home to 400G and add 100G space to /. What should I do? # df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 50G 50G 341M 100%…
42
votes
4 answers

I updated my CentOS 7 system. Why is Meltdown/Spectre only partially mitigated?

Like many of us, I spent yesterday updating a whole lot of systems to mitigate the Meltdown and Spectre attacks. As I understand it, it is necessary to install two packages and…
Michael Hampton
  • 252,907
39
votes
5 answers

Centos 7 Extend partition with unallocated space

I have centos 7 server (CentOS Linux release 7.3.1611 (Core)) When I was updated my server I saw error you need extra space. But I had 20GB disk on server when I check disk spaces I saw only 4.5GB partition created and 16GB partition is free space…
kibar
  • 493
30
votes
7 answers

CentOS 7 - end of life in 2024, then what

We are working on a software solution and some of our providers are really CentOS 7 centered. CentoS 7 will continue to produce through the remainder of the RHEL 7 life cycle, which will end sometime in 2024. CentOS 8 will receive updates till…
29
votes
5 answers

How to remove access to a port using firewall on Centos7?

Had a port opened up to for public use using firewall-cmd, I wanted to limit this port to a specific IP which I found the answer for on this SITE. I used the following to open it: $ firewall-cmd --permanent --zone=public --add-port=10050/tcp $…
mcv
  • 1,015
29
votes
3 answers

Permanently enable a SCL

Is there a way that I can permanently enable a SCL? I've installed rh-php56, and I would like to make sure that it is loaded every time I ssh into my machine. I am currently running CentOS 7.
Odyss3us
  • 405
28
votes
2 answers

Proper way to deal with corrupt XFS filesystems

I recently had an XFS filesystem become corrupt due to a powerfail. (CentOS 7 system). The system wouldn't boot properly. I booted from a rescue cd and tried xfs_repair, it told me to mount the partition to deal with the log. I mounted the…
27
votes
1 answer

How can I add a default gateway with the ip command, not the route command?

I want to set a default gateway using the ip route command, since I'm under the impression that ip is newer and preferred. If I'm not mistaken, ip is included in a minimal CentOS installation and not route. What's the equivalent of route add default…
royco
  • 743
1
2 3
99 100