Tag Archives: Permission denied

Centos Failed to Modify the port of SSH: error: Bind to port 27615 on 0.0.0.0 failed: Permission denied.

Error screenshot

problem causes

selinux problem

Solution

Modify the port of sshd in selinux

# Install the modification tool
$ yum -y install policycoreutils-python

# Check the port of sshd in selinux, the output is 22
$ semanage port -l | grep ssh

# New ports
$ semanage port -a -t ssh_port_t -p tcp 27615

$ systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2022-10-29 10:10:08 CST; 36min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 8653 (sshd)
   CGroup: /system.slice/sshd.service
           └─8653 /usr/sbin/sshd -D

Oct 29 10:10:08 centos-linux.shared systemd[1]: Starting OpenSSH server daemon...
Oct 29 10:10:08 centos-linux.shared sshd[8653]: Server listening on 0.0.0.0 port 27615.
Oct 29 10:10:08 centos-linux.shared systemd[1]: Started OpenSSH server daemon.
Oct 29 10:31:44 centos-linux.shared sshd[18735]: Accepted password for root from 10.211.55.2 port 50375 ssh2

failed (13: Permission denied) while reading upstream [How to Solve]

Error Messages:

2022/10/20 18:38:56 [crit] 67121#0: *16996 open() "/app/openresty/nginx/proxy_temp/8/03/0000000038" failed (13: Permission denied) while reading upstream, client: 100.xxx.xxx.92, server: sfimplat.sf-express.com, request: "GET /sfimplat/release/issuesql/query HTTP/1.1", upstream: "http://100.111.xxx.xxx:9080/sfimplat/release/issuesql/query", host: "100.111.136.71", referrer: "http://100.xxx.xxx.xxx/issue/sql/approve"

 

Solution:

Modify the following codes:

vi /usr/local/nginx/conf/nginx.conf

#use nobody;

to

use root;

Restart Nginx and it will be OK!

Developing in Android java.net.SocketException : socket failed: eacces (permission denied) reported an error

in the android development java.net.SocketException: socket failed: EACCES (Permission denied) error

knowledge point:

1, SocketException network operation error;

2. Solutions; (turned out to be a single user to close our app networking permissions, now new android system can be set for a permission)

today I met a user feedback, is that the problem encountered, click login, but unable to login, but prompt java.net.SocketException: socket failed: EACCES (Permission denied) this information. The first reaction is lack of network access, and then hurriedly check whether to join the network access.

adds

to the androidmanifest

<uses-permission android:name=“android.permission.INTERNET”/>

However, I already wrote it in the program. It’s rare to write an Android app project that doesn’t connect to the Internet, so this should be included in the first place. So, this problem is eliminated. However, I found a lot of information, but did not find a suitable description and solution. It can’t be me.

so here are some of the possible reasons I’m looking for.

but I don’t have the user’s phone, otherwise the log error will be clear. Now you have to ask the user to download the app again. And then it’s OK. This is a real pain in the ass.

There’s a new possible issue: users have disabled your app’s access to the network. Notice that it’s a single block. So give your application access to the Internet based on the system.

For example, the operation of xiaomi mobile phone is: find the “security center” app, enter, and then see the “network assistant”, enter, and then click “network control”, find the corresponding app, check whether the corresponding “data” and “WLAN” options are hooked.

or

Java file network operation, add the following code

StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build());

reason:

is most likely because the code for the possible network operation was written in the UI thread, which has not been allowed since android 4.0. Because network operations are done in the UI thread, if the network is bad then the whole program is easy to ANR. So android4.0 will have to open a new thread for code that wants to operate on the network.

or

network permissions are written like this:

<uses-permission android:name=“android.permission.INTERNET"/>

instead of writing

<permission  android:name=“android.permission.INTERNET"></permission>

or

important – the uses-permission tag needs to be before the application tag in the manifest file. thats what fixed it for me at least.

outside the wall say: permissions to be in < application> Only when the tag is introduced can it work. (but I write that all the time, no problem) — get rid of

or

after you restart the ide, you can run the code normally again.

total reason:

lack of permissions?

permission error?

network operation in UI thread?

port occupation caused?

android version issues?

development tool problem?Restart and recompile