Port forwarding not working

General support questions
Post Reply
arshdeep.thapar
Posts: 1
Joined: 2018/12/02 13:07:35

Port forwarding not working

Post by arshdeep.thapar » 2018/12/02 13:17:10

Hi

I am using centOS on Oracle VMWare.
Earlier port forwarding was working fine.
2 days back I gave chmod 777 * on root.
Yesterday I restarted my machine and tried working from my local via port forwarding.
It is showing this error:

Network error: Connection refused

What should I do to restore it? Is this some firewall issue?

It would take time for me to reinstall. Is there any other option?

Regards
Arshdeep

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Port forwarding not working

Post by TrevorH » 2018/12/02 14:53:47

I am using centOS on Oracle VMWare.
ITYM VirtualBox not VMWare.
2 days back I gave chmod 777 * on root.
Yuck, that was a stupid thing to do. Your first step to recovering this, assuming that you can logon at all, is to run

for p in $(rpm -qa); do rpm --setperms $p; rpm --setugids $p; done

That does a loop over all installed packages and tells rpm to set the permissions and group ownership back to what is specified in the package spec.

However, due to a bug in rpm, that does cause other problems so once that is complete you need to use rpm -Va to get a list of all files that do not match the way they are defined in the rpm. Any files that are listed as not matching "capabilities" will then need their owning packages yum reinstall'ed to correct them. For example. if you run rpm --setugids iputils then it removes the capabilities from /usr/bin/ping and /usr/sbin/{arping,clockdiff} and an rpm -V iputils will list those like so:

Code: Select all

[root@centos7 ~]# rpm -V iputils
........P    /usr/bin/ping
........P    /usr/sbin/arping
........P    /usr/sbin/clockdiff
So, run rpm -Va and then for each file listed as missing "........P" use rpm -qf on that filename to get the owning package then yum reinstall that package.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply