fbpx

How to Fix Cannot open your terminal ‘/dev/pts/2’ – please check

Normally we see a common error when we switch or sudo to a user to run the screen session and it gets closes with the error ‘Cannot open your terminal ‘/dev/pts/2′ – please check’. fix it very tiny but it took a long for me to find so I thought I will share the quick fix and save our prices time.

Error:

[thedbadmin@testdb01 ~]$ screen -x 12991.screen_testCannot open your terminal ‘/dev/pts/0’ – please check.[thedbadmin@testdb01 ~]$

Step 1: logout from the user that you have logged in.

Step 2: log as your user or from where you want to run screen and just give full privileged to /dev/pts/* 

Fix : 
$ chmod 777 /dev/pts/*

 

Note: if you get any warning or error after executing the above command,  just ignore it safely.

Now you can start the screen again hopefully you won’t see that error again

Happy programming !!!

Apache Tomcat: java.net.BindException: Permission denied (Bind failed) :443

How to fix error: Apache tomcat : java.net.BindException: Permission denied (Bind failed) <null>:443

 

Full Error:

SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-4443"]
java.net.BindException: Permission denied (Bind failed) <null>:4443
	at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413)
	at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:715)
	at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:452)
	at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
	at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
	at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
	at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:840)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:642)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:667)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
Caused by: java.net.BindException: Permission denied (Bind failed)
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
	at java.net.ServerSocket.bind(ServerSocket.java:390)
	at java.net.ServerSocket.<init>(ServerSocket.java:252)
	at java.net.ServerSocket.<init>(ServerSocket.java:196)
	at javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:136)
	at sun.security.ssl.SSLServerSocketImpl.<init>(SSLServerSocketImpl.java:71)
	at sun.security.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:80)
	at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:256)
	at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:400)
	... 17 more

 

Why, when, and where we get this error?

 

We get this issue while starting Apache tomcat on secure port 443. The error “java.net.BindException: Permission denied (Bind failed) :443 ” is visible in /usr/share/tomcat/logs/catalina.2016-12-02.log

 

How to fix it

This error occurs when your Linux firewall levels are set to ‘enforcing‘.To fix this error make it ‘permissive

  1. Check current firewall status using the command ‘getenforce
  2. Edit the file ‘vi /etc/selinux/config’ and make it ‘permissive’ from ‘enforcing’
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #       enforcing - SELinux security policy is enforced.
    #       permissive - SELinux prints warnings instead of enforcing.
    #       disabled - No SELinux policy is loaded.
    SELINUX=permissive
    # SELINUXTYPE= can take one of these two values:
    #       targeted - Targeted processes are protected,
    #       mls - Multi Level Security protection.
    SELINUXTYPE=targeted
  3. Reboot the system using ‘reboot‘ as the root
  4. After reboot check, if tomcat is up with 443 port
    netstat -plan| grep 443
  5. And check the tomcat URL with ssl/https  (https://localhost:443)

Leave a comment if you find the article helpful.

 

Read More

How to fix ORA-28368: cannot auto-create wallet
AWS Services and their Azure alternatives 
How to Manage AWS S3 Bucket with AWS CLI

How to connect PostgreSQL Database from PgAdmin
How to create AWS rds PostgreSQL Database
Convert pem to ppk
How to Install PuTTy on Window
How to Install and create AWS EC2 Instance using Terraform
AWS MySQL RDS Database Creation using AWSCLI
How to Create MySQL Database with AWS RDS
How to connect to AWS MySQL / MariaDB RDS or EC2 database from MySQL WorkBench