- If you have CWPpro licence, first change IP to new one at https://support.centos-webpanel.com/clientarea.php and then follow following steps
- Create/update reverse DNS in your VPS provider. That would be your new hostname.
- Create nameservers with new IP in Domain registrar.
- Go to CWP Settings and then IP Manager and add the new IP address with Netmask and Gateway. Note that you have to configure the VPS with new IP and test it accordingly.
- Go to Server Settings and then Change Hostname and replace New Hostname with rDNS/PTR records of your Default/New IP. Confirm that everything here looks ok.
- Go to User Accounts and then List Accounts and you need to go to “Edit Account” section of all accounts on your server and replace IP field with Default/New IP Address (you also must check the “Update DNS Zone” checkbox). Test one account first and if it works then go for all accounts. SSL may cause but will be resolved automatically. You may have to use VPN to test.
- Go to CWP Settings and then Edit Settings and replace Shared IP field with Default/New IP Address. Check the “Rebuild vHosts” check box and save changes.
- Go to DNS Functions and then Edit Nameservers IPs and replace all NS1 and NS2 IPs with Default/New IP Address.
- After completing all of the above, rebuild WebServer in order to prevent future issues , So you need to Go to Apache Settings and then Apache Re-Build and recompile your apache webserver
- If you were using Varnish Cache or Nginx Reverse Proxy you must have to Go to Apache Settings and then Select WebServers and select Default Web Servers which you were using and Click on “Save & Rebuild Configuration“.
- if you were using MailServer you should Rebuild your MailServer. Go to Email and then MailServer Manager and Rebuilt Mail Server. If you need to restart all mail server services (Postfix, ClamAV, Amavis, Spamassassin, Dovecot) you can do that here.
- Reboot your server
- Enjoy!
How to change the SSH port 22
How to change the SSH port
- Log in to your server using the current SSH port (default 22).
Note that you should not close this SSH connection until you have verified that you can access SSH on the new port number. - Open / etc/ssh/sshd_config
vi /etc/ssh/sshd_config
- Set your Port. For example 1234
Port 1234
- Restart SSHD
/scripts/restartsrv_sshd
or
sudo systemctl restart ssh.service
- Configure any firewalls with the new SSH port.
- Test SSH with new port 1234
ssh USER@HOSTNAME -p1234
Use your USER and HOSTNAME and the password and confirm new port.
If the SSH test on the new port is successful you can close the connection. If it is not successful, this SSH connection should not be closed until the SSH test on the new port is successful. Else revert the port to previous state and restart.
find / -name “sshd_config” -print
/usr/share/openssh/sshd_config
/etc/ssh/sshd_config
find / -name “sshd_config” 2>/dev/null
vi /usr/share/openssh/sshd_config
vi /etc/nftables.conf
ufw allow 1234/tcp
vi /etc/services
systemctl restart ssh
service ssh restart
systemctl restart ssh.service
ssh root@server_ip -p NEW_PORT
ssh root@123.512.11.6 -p 1234
How to change root password of CWP and CWP pro
- Change root password in CentOS Web Panel
- CWP admin password – How we reset it via panel
- Change root password in CentOS Web Panel
Login to CWP account
- Go to Server Settings->Change Root Password.
- Enter your new password; confirm the new password.
- Click the Change Root Password button.
- You will see the confirmation message:
Changing password for user root. passwd: all authentication tokens updated successfully.
How to change the default SSH Port 22 to your choice | CWP
WARNING: Security vulnerability! Your server is using default SSH Port 22, to make your server more secure change SSH port in config file /etc/ssh/sshd_config and in CSF firewall !
After changes are done don’t forget to restart SSH and CSF Firewall.
- After login to CWP go to Services Config->SSH Configuration. This will open /etc/ssh/sshd_config
- Then go to Security->CSF Firewall, click the Firewall Configuration button. This will open /etc/csf/csf.conf
- Look for the #Allow incoming TCP ports section and add your port number to the list.
- Save changes
- On cwp dashboard, restart SSH server.
- Then go to Security->CSF Firewall, click the Firewall Restart button