Question: How to confgure ssh to run on 2 ports i.e. 22 and 2222. There may be requirements as such above in some environments to run ssh on multiple ports. Well this can be achieved by modifying the /etc/ssh/sshd_config configuration file. The stpes are outlined as below: 1. Edit the sshd configuration file /etc/ssh/sshd_config # […]
CentOS/RHEL 5
Bind to port 22 on 0.0.0.0 failed: address already in use – error while starting sshd service CentOS/RHEL
The Problem Following messages are logged when restarting sshd service in a CentOS/RHEL 5/6 system. Dec 14 00:15:19 geeklab sshd[9182]: Received signal 15; terminating. Dec 14 00:15:19 geeklab sshd[9274]: Server listening on :: port 22. Dec 14 00:15:19 geeklab sshd[9274]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use. The Solution When […]
“error: Bind to port 2222 on 0.0.0.0 failed: Permission denied” – error while starting sshd service on CentOS/RHEL
The Problem On CentOS/RHEL, the OpenSSH SSH Daemon (sshd) utilizes port 22 for incoming connection requests from remote OpenSSH SSH (ssh) and Secure File Transfer (sftp) clients. In some cases, however, System Administrators prefer to utilize separate ports to service ssh and sftp activity. In One such case, system administrator is facing below error while […]
How to Automatically Run ntpdate When Starting NTPD in CentOS/RHEL 5
Question: How to Automatically Run ntpdate When Starting NTPD in CentOS/RHEL 5? 1. By default the file /etc/ntp/step-tickers is empty, to sync the time with ntpdate during the start of ntpd, we need to enter the ip addresses of your time server: # cat /etc/ntp.conf | grep server server 192.168.X.1 server 192.168.Y.2 # cat /etc/ntp/step-tickers […]
Set Password for Single User Mode on Linux (CentOS/RHEL)
Setting Password for Single User Mode in Linux adds security to Linux boxes. If someone accesses your server physically & reboots the server and then tries to change the root password from single-user mode. In that case, if the password is set on single-user mode, one has to first enter the root password, then only […]
“Server refused to allocate pty” – Unable to login to CentOS/RHEL
The Problem On an CentOS/RHEL 6 server, all logins started to fail to the system with the following errors: Server refused to allocate pty /etc/profile: line 48: /dev/null: Permission denied /etc/profile: line 76: /dev/n ull: Permission denied /etc/profile: line 76: /dev/null: Permission denied /etc/pr ofile: line 76: /dev/null: Permission denied /etc/profile: line 76: /dev/null: Permission […]
“Connection reset by peer” – error while ssh into a CentOS/RHEL system with a specific user only
The Problem When trying to open an ssh connection to a system with a specific account, it failed with ‘Connection reset by peer’. Other users can successfully connect with ssh to this system. Below is an example showing the failed login to node [NODE2] with the account ‘oracle’. [oracle@NODE1]$ ssh oracle@[NODE2] oracle@[NODE2]’s password: Read from […]
How to Configure NFS Services (server-side) to Run on Static Ports as an Alternative CentOS/RHEL 5 and 6
By default, some NFS services (server_side) use well-known ports but some normally just use random ports. The use of random ports does not work so well with strict firewall rules blocking random yet unknown ports. So, sometimes it is best to manually alter or specify static ports for NFS services (server_side) to use. This post […]
Failed to start LSB: Bring up/down networking – On restarting network service CentOS/RHEL (DHCP client)
The Problem Cannot reliably get networking to start on a server when using DHCP: # sudo /etc/init.d/network restart Restarting network (via systemctl): Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journalctl -xe” for details. [FAILED] # journalctl -xe Nov 29 18:57:42 hostaname.domain.com dhclient[37653]: exiting. Nov 29 […]
How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
Sometimes not all log messages in /var/log/dmesg can be captured after Linux OS/kernel boots up because of too many block devices attached to the server. This post illustrates another way to record all bootup log messages besides configuring the serial console. Basically kernel parameter “log_buf_len” can be configured to increase kernel log buffer size, Name: […]