1. 修改postgresql.conf

postgresql.conf存放位置在

/etc/postgresql/x.x/main

这里的x取决于你安装PostgreSQL的版本号,编辑或添加下面一行,使PostgreSQL可以接受来自任意IP的连接请求。

listen_addresses = '*'

2. 修改pg_hba.conf

增加这一行

#TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 0.0.0.0/0 md5

3. 重启服务

sudo service postgresql restart

第二步,修改密码

此时,远程登录时,可能提示密码不正确,修改默认用户的密码。
切换账号:sudo -u postgres psql
修改密码:ALTER USER postgres WITH PASSWORD 'postgres';(注意后面有分号)

或者直接修改 Linux 账户的密码(未尝试)

步骤一:删除用户postgres的密码
sudo passwd -d postgres

步骤二:设置用户postgres的密码
sudo -u postgres passwd

系统提示输入新的密码
Enter new UNIX password:
Retype new UNIX password:

如果想新建不同的账户,则按照 Linux 创建账号的步骤来就可以了,因为 PostgreSQL 默认使用的是基于 Linux 的账户认证系统。

10 条评论

  • 男人家 2019/12/16 10:01 回复

    雁过留声!

  • Hollie Hack 2024/03/30 23:26 回复

    Discover hassle-free access to BG/SBLC financial instruments with us. Benefit from our direct links to esteemed banks like HSBC, ensuring swift lease or purchase options tailored to your needs. Our strengths lie in quick transactions, global funding solutions, and rewarding referral bonuses. Intermediaries such as brokers and consultants are warmly welcomed to join our network. Contact us today at +852 3001 8851 or [email protected], or visit our website at https://bestcapital.hk to experience the best in financial solutions.

  • Silvia Purvis 2024/04/19 03:15 回复

    Most people get absolutely railed by life because they have ZERO idea how to create their own Digital Business Online. Some of you been stuck in a “rut” for years. You have no idea how to “Jump-Start” the car that is your life. Today I want you to have a Business In-A-Box, Done For You and you can start it by tomorrow, become a reseller and make money while others are sleeping! Go to: https://plrwebsite.com/

  • Zoila Murry 2024/06/03 11:46 回复

    Social Media Jobs from the comfort of home!

    Positions Available Now!

    We currently have several openings for social media workers.

    Discover how you can monetize your social media savvy: —–> https://cashonsocial.com

  • Juan Dulaney 2024/06/13 03:00 回复

    You can have Easy Access to UK, USA and Canada Business Loans Find out more

    https://www.goldminds.cloud/usa-and-canada-loans/

  • Ignacio Lacey 2024/08/10 21:38 回复

    Are you concerned that your current website that was built a few years back,is no longer a good representation of your company ?

    Why pay $50+ per hour for web development work,
    when you can get higher quality results AT LESS THAN HALF THE COST?

    We are a FULL SERVICE, USA managed web development agency offering wholesale pricing.

    No job too big or small. Test us out to see our value.

    Use the link in my signature, for a quick turn around quote.

    Kristine Avocet
    Senior Web Specialist
    Fusion Web Experts
    186 Daniel Island Drive
    Daniel Island, SC 29492
    http://www.fusionwebexperts.tech

  • Maybell Ancher 2024/09/03 09:00 回复

    The best financial company to support your business growth is right here.

    We are here to offer you the greatest option for the expansion of your company. To fulfill your needs, we offer the best possible business loan package. email me here [email protected]

    Best Regards Laura Cha

  • Kurtis Veale 2024/10/02 22:01 回复

    Tired of overpaying for simple web work & website updates?

    Why pay $45+ per hour for Web Development work,
    when you can get higher quality results AT LESS THAN HALF THE COST?

    We are a FULL SERVICE, USA managed, web development agency at WHOLESALE PRICING.

    We charge $20 per hour compared to $35 -$75 per hour in the market.
    We can also do flat project based pricing if that’s your preference.

    No job too big or too small. Test us out to see our value.

    Use the link in my signature, for a quick turn around quote.

    Warmly,

    Dan Setzinger
    Senior Web Specialist
    Fusion Web Experts
    186 Daniel Island Drive
    Daniel Island, SC 29492
    [email protected]
    https://www.FusionWebExpertsUSA.com

  • Rory Osullivan 3 周之前 回复

    CRYPTOCURRENCY FOR BEGINNERS

    Are you curious about cryptocurrencies but don’t know where to start? “Cryptocurrency for Beginners” is the perfect guide to help you understand the basics of this exciting and rapidly evolving world.
    This ebook covers everything you need to know, from the history of cryptocurrencies to how they work, and even how to get started with buying, selling, and investing. Whether you’re looking to understand how blockchain technology works or curious about the future of digital currencies, this ebook will walk you through all the essential concepts in easy-to-understand terms.
    Inside this ebook, you’ll learn about:
    What Cryptocurrency Is & Why It’s Important: Get a clear understanding of digital currencies and their significance in today’s economy.
    How Cryptocurrency Works: Learn the basics of blockchain, decentralization, and the technology that powers cryptocurrencies.
    Popular Cryptocurrencies: Discover well-known cryptocurrencies like Bitcoin, Ethereum, Ripple (XRP), and Litecoin, and how they compare.
    Buying & Selling Cryptocurrency: Step-by-step guidance on where and how to buy and sell cryptocurrencies safely.
    Using Cryptocurrency: Explore how cryptocurrencies are used for transactions, transfers, and in e-commerce, along with how smart contracts and decentralized apps (DApps) work.
    Investing in Cryptocurrency: Learn the potential benefits of investing in digital currencies, how to manage risks, and how to diversify your portfolio.
    Legal & Regulatory Issues: Understand government stances on cryptocurrencies, legal concerns, and what the future of cryptocurrency regulations might look like.
    Security & Fraud Prevention: Tips on how to stay safe, avoid scams, and protect your investments from common threats.
    The Future of Cryptocurrency: Stay ahead of the curve with insights into emerging trends and the impact cryptocurrencies could have on the global economy.
    Final Thoughts: Whether you’re a complete beginner or looking to refine your understanding, “Cryptocurrency for Beginners” is your go-to resource for diving into the world of digital currencies. By the end of this ebook, you’ll be equipped with the knowledge you need to navigate the cryptocurrency landscape with confidence.
    https://selar.co/3hbhx7

  • Margery Kolb 1 周之前 回复

    Logistics is complex. Container drayage? Pure chaos. That’s where Rely-Ex Solutions delivers. We provide fast, precise insights with total transparency—no surprises, ever. From your shipments to your data, we handle it all with care and accuracy. Our clients trust us because we don’t just meet expectations; we exceed them. Start with container drayage, stay for the full-service expertise. Ready to streamline your logistics? Contact us at [email protected] or visit http://www.shiprelyex.com.

  • :arrow:
  • :grin:
  • :???:
  • :cool:
  • :cry:
  • :shock:
  • :evil:
  • :!:
  • :idea:
  • :lol:
  • :mad:
  • :mrgreen:
  • :neutral:
  • :?:
  • :razz:
  • :oops:
  • :roll:
  • :sad:
  • :smile:
  • :eek:
  • :twisted:
  • :wink: