linux 防火墙打开5432 端口,在Ubuntu上打开端口5432

linux 防火墙打开5432 端口,在Ubuntu上打开端口5432问题描述我正在尝试使用sudoufwallow5432/tcp的ufw在ubuntu上打开端口5432然后,我使用nmap查看端口5432是否已打开,并且得到以下信息:root@domain:~#sudonmap-sS-O127.0.0.1StartingNmap5.21(http://nmap.org)at2011-12-0114:28MSKNmapscan…

大家好,又见面了,我是你们的朋友全栈君。

问题描述

我正在尝试使用sudo ufw allow 5432/tcp的ufw在ubuntu上打开端口5432

然后,我使用nmap查看端口5432是否已打开,并且得到以下信息:

root@domain:~# sudo nmap -sS -O 127.0.0.1

Starting Nmap 5.21 ( http://nmap.org ) at 2011-12-01 14:28 MSK

Nmap scan report for localhost.localdomain (127.0.0.1)

Host is up (0.000084s latency).

Not shown: 994 closed ports

PORT STATE SERVICE

22/tcp open ssh

25/tcp open smtp

80/tcp open http

587/tcp open submission

5432/tcp open postgresql

10000/tcp open snet-sensor-mgmt

Device type: general purpose

Running: Linux 2.6.X

OS details: Linux 2.6.15 – 2.6.30

Network Distance: 0 hops

OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .

Nmap done: 1 IP address (1 host up) scanned in 2.28 seconds

root@domain:~# sudo nmap -sS -O 1xx.xxx.xxx.xxx

Starting Nmap 5.21 ( http://nmap.org ) at 2011-12-01 14:30 MSK

Nmap scan report for domain.info (1xx.xxx.xxx.xxx)

Host is up (0.000086s latency).

Not shown: 997 closed ports

PORT STATE SERVICE

22/tcp open ssh

80/tcp open http

10000/tcp open snet-sensor-mgmt

Device type: general purpose

Running: Linux 2.6.X

OS details: Linux 2.6.15 – 2.6.30

Network Distance: 0 hops

OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .

Nmap done: 1 IP address (1 host up) scanned in 2.65 seconds

1xx.xxx.xxx.xxx是我的服务器的IP。

我已经编辑了pg_hba.conf:

# DO NOT DISABLE!

# If you change this first entry you will need to make sure that the

# database

# super user can access the database using some other method.

# Noninteractive

# access to all databases is required during automatic maintenance

# (custom daily cronjobs, replication, and similar tasks).

#

# Database administrative login by UNIX sockets

local all postgres ident

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# “local” is for Unix domain socket connections only

local all all ident

# IPv4 local connections:

host all all 0.0.0.0/0 md5

# IPv6 local connections:

host all all ::1/128 md5

但是端口5432尚未打开。

最佳思路

您需要编辑pg_hba.conf:

host all all 192.168.0.0/24 trust

这允许每个192.168.0.0/24网络进行连接。所有的wild-card将是0.0.0.0/0。更多信息here。

然后编辑postgresql.conf并更改listen_address:

listen_addresses=’*’

参考资料

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/150954.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 清除挖矿脚本 minerd[通俗易懂]

    清除挖矿脚本 minerd[通俗易懂]症状:cup占用率飙高原因:这次入侵是由于redis没有设置用户名密码,没有限制访问ip导致 解决方法:ps-eopcpu,args–sort=%cpu|head  找到飙高的程序是minerdTOP查看minerd的pidkill-s9pid(pid的值每个服务器不同)rm-rf /var/spool/cron/cronta

    2022年7月13日
    21
  • 服务器查看外网IP地址和方法

    服务器查看外网IP地址和方法返回IP地址curlip.6655.com/ip.aspxcurlwhatismyip.akamai.comwget-qO-ifconfig.cocurlicanhazip.comdig+shortmyip.opendns.com@resolver1.opendns.comcurlident.mecurlv4.ident.mecurlcu…

    2022年5月30日
    54
  • 欧拉函数求法

    欧拉函数求法欧拉函数是计算在1-n中n的质因数的个数;φ(x)=x*(p1-1)/p1*(p2-1)/p2*(p3-1)/p3…*(pn-1)/pn其中p1,p2,p3…是x的质因数;若x是质数:φ(x)=x-1若x是质数p的k次幂(即x=p^k):φ(x)=p^k-p^(k-1)=(p-1)p^(k-1)积性:φ(n*m)=φ(n)*φ(m)其中m、n互质。具体的证明和其他介绍就不多说了=.

    2022年8月22日
    9
  • JSP的七大动作和三大指令

    JSP的七大动作和三大指令JSP的七大动作和三大指令

    2022年4月22日
    34
  • mysql数据类型tinyint_公司的类型及区别是什么

    mysql数据类型tinyint_公司的类型及区别是什么MySQL支持多种数据类型,大致可以分为三类:数值、日期/时间和字符串(字符)类型。其中,整数类型包括:tinyint、smallint、mediumint、int和bigint。其中,tinyint的大小为1字节,即8位二进制。在无符号的情况下,值得范围(0,255)。在有符号的情况下,值得范围(-128,127)。本文将通过测试验证tinyint值的范围。1.有符号…

    2022年9月21日
    3
  • clover无缘无故隐藏书签栏原因

    clover无缘无故隐藏书签栏原因

    2021年11月3日
    48

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号