Why can't I create a superuser in AWS Postgresql instance? The 2019 Stack Overflow Developer Survey Results Are InPostgres database post-expiration of user password unable to loginWhy can't user login on PostgresAWS RDS CLI: AccessDenied on CreateDBSnapshotCannot SSH to my AWS Linux instance after rebooting itAWS RDS db.t2 instance performance thresholds & monitoringHow to store a login path for psql?Why do I need an IAM user when I can create an Instance from main account?Creating a read only account for AWS RDS PostgreSQLHow can my client give me access to his AWS account?Unknown Database when trying to connect to an AWS RDS instance

Why is Grand Jury testimony secret?

How can I fix this gap between bookcases I made?

Realistic Alternatives to Dust: What Else Could Feed a Plankton Bloom?

What do the Banks children have against barley water?

Extreme, unacceptable situation and I can't attend work tomorrow morning

aging parents with no investments

Does it makes sense to buy a new cycle to learn riding?

What is the motivation for a law requiring 2 parties to consent for recording a conversation

Manuscript was "unsubmitted" because the manuscript was deposited in Arxiv Preprints

Is "plugging out" electronic devices an American expression?

Geography at the pixel level

Lethal sonic weapons

Unbreakable Formation vs. Cry of the Carnarium

What do hard-Brexiteers want with respect to the Irish border?

Springs with some finite mass

On the insanity of kings as an argument against Monarchy

"To split hairs" vs "To be pedantic"

How to create dashed lines/arrows in Illustrator

How was Skylab's orbit inclination chosen?

Could JWST stay at L2 "forever"?

"What time...?" or "At what time...?" - what is more grammatically correct?

Carnot-Caratheodory metric

How to make payment on the internet without leaving a money trail?

Idiomatic way to prevent slicing?



Why can't I create a superuser in AWS Postgresql instance?



The 2019 Stack Overflow Developer Survey Results Are InPostgres database post-expiration of user password unable to loginWhy can't user login on PostgresAWS RDS CLI: AccessDenied on CreateDBSnapshotCannot SSH to my AWS Linux instance after rebooting itAWS RDS db.t2 instance performance thresholds & monitoringHow to store a login path for psql?Why do I need an IAM user when I can create an Instance from main account?Creating a read only account for AWS RDS PostgreSQLHow can my client give me access to his AWS account?Unknown Database when trying to connect to an AWS RDS instance



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








10















I have an AWS EC2 instance connecting to an RDS instance (Postgresql). When I created the RDS instance, I told it the DB root's username was: my_user1 and the password was password1. Now I'm attempting to create a role and a super-user. But it fails:



$ createuser -P -d -s -e my_user2 --host myhost.com -U my_user1
Enter password for new role: XXXYYYZZZ
Enter it again: XXXYYYZZZ
Password: password1
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f999c' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
createuser: creation of new role failed: ERROR: must be superuser to create superusers
$


When I repeat the command without the -s flag, it works:



$ createuser -P -d -e my_user2 --host myhost.com -U my_user1
Enter password for new role:
Enter it again:
Password:
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f888c' NOSUPERUSER CREATEDB NOCREATEROLE INHERIT LOGIN;
$


So clearly, my_user1 doesn't have permissions to create a super-user. But this is the user I told RDS was my admin user! If my_user1 doesn't have permissions to create a super-user, who does? And how do I get their username/password from AWS?










share|improve this question
























  • does the pg_hba.conf say the authentication scheme is peer for local users ?

    – drookie
    Jan 22 '15 at 20:19











  • Drookie, is this file on the RDS instance itself? I haven't even SSHed onto that machine yet.

    – Saqib Ali
    Jan 22 '15 at 20:42











  • @SaqibAli You can't SSH into a RDS instance.

    – ceejayoz
    Jan 22 '15 at 21:51

















10















I have an AWS EC2 instance connecting to an RDS instance (Postgresql). When I created the RDS instance, I told it the DB root's username was: my_user1 and the password was password1. Now I'm attempting to create a role and a super-user. But it fails:



$ createuser -P -d -s -e my_user2 --host myhost.com -U my_user1
Enter password for new role: XXXYYYZZZ
Enter it again: XXXYYYZZZ
Password: password1
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f999c' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
createuser: creation of new role failed: ERROR: must be superuser to create superusers
$


When I repeat the command without the -s flag, it works:



$ createuser -P -d -e my_user2 --host myhost.com -U my_user1
Enter password for new role:
Enter it again:
Password:
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f888c' NOSUPERUSER CREATEDB NOCREATEROLE INHERIT LOGIN;
$


So clearly, my_user1 doesn't have permissions to create a super-user. But this is the user I told RDS was my admin user! If my_user1 doesn't have permissions to create a super-user, who does? And how do I get their username/password from AWS?










share|improve this question
























  • does the pg_hba.conf say the authentication scheme is peer for local users ?

    – drookie
    Jan 22 '15 at 20:19











  • Drookie, is this file on the RDS instance itself? I haven't even SSHed onto that machine yet.

    – Saqib Ali
    Jan 22 '15 at 20:42











  • @SaqibAli You can't SSH into a RDS instance.

    – ceejayoz
    Jan 22 '15 at 21:51













10












10








10


2






I have an AWS EC2 instance connecting to an RDS instance (Postgresql). When I created the RDS instance, I told it the DB root's username was: my_user1 and the password was password1. Now I'm attempting to create a role and a super-user. But it fails:



$ createuser -P -d -s -e my_user2 --host myhost.com -U my_user1
Enter password for new role: XXXYYYZZZ
Enter it again: XXXYYYZZZ
Password: password1
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f999c' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
createuser: creation of new role failed: ERROR: must be superuser to create superusers
$


When I repeat the command without the -s flag, it works:



$ createuser -P -d -e my_user2 --host myhost.com -U my_user1
Enter password for new role:
Enter it again:
Password:
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f888c' NOSUPERUSER CREATEDB NOCREATEROLE INHERIT LOGIN;
$


So clearly, my_user1 doesn't have permissions to create a super-user. But this is the user I told RDS was my admin user! If my_user1 doesn't have permissions to create a super-user, who does? And how do I get their username/password from AWS?










share|improve this question
















I have an AWS EC2 instance connecting to an RDS instance (Postgresql). When I created the RDS instance, I told it the DB root's username was: my_user1 and the password was password1. Now I'm attempting to create a role and a super-user. But it fails:



$ createuser -P -d -s -e my_user2 --host myhost.com -U my_user1
Enter password for new role: XXXYYYZZZ
Enter it again: XXXYYYZZZ
Password: password1
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f999c' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
createuser: creation of new role failed: ERROR: must be superuser to create superusers
$


When I repeat the command without the -s flag, it works:



$ createuser -P -d -e my_user2 --host myhost.com -U my_user1
Enter password for new role:
Enter it again:
Password:
CREATE ROLE my_user2 PASSWORD 'md5999999c0101a1d64afd57575e06f888c' NOSUPERUSER CREATEDB NOCREATEROLE INHERIT LOGIN;
$


So clearly, my_user1 doesn't have permissions to create a super-user. But this is the user I told RDS was my admin user! If my_user1 doesn't have permissions to create a super-user, who does? And how do I get their username/password from AWS?







amazon-web-services postgresql amazon-rds






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 22 '15 at 20:45







Saqib Ali

















asked Jan 22 '15 at 19:52









Saqib AliSaqib Ali

1941317




1941317












  • does the pg_hba.conf say the authentication scheme is peer for local users ?

    – drookie
    Jan 22 '15 at 20:19











  • Drookie, is this file on the RDS instance itself? I haven't even SSHed onto that machine yet.

    – Saqib Ali
    Jan 22 '15 at 20:42











  • @SaqibAli You can't SSH into a RDS instance.

    – ceejayoz
    Jan 22 '15 at 21:51

















  • does the pg_hba.conf say the authentication scheme is peer for local users ?

    – drookie
    Jan 22 '15 at 20:19











  • Drookie, is this file on the RDS instance itself? I haven't even SSHed onto that machine yet.

    – Saqib Ali
    Jan 22 '15 at 20:42











  • @SaqibAli You can't SSH into a RDS instance.

    – ceejayoz
    Jan 22 '15 at 21:51
















does the pg_hba.conf say the authentication scheme is peer for local users ?

– drookie
Jan 22 '15 at 20:19





does the pg_hba.conf say the authentication scheme is peer for local users ?

– drookie
Jan 22 '15 at 20:19













Drookie, is this file on the RDS instance itself? I haven't even SSHed onto that machine yet.

– Saqib Ali
Jan 22 '15 at 20:42





Drookie, is this file on the RDS instance itself? I haven't even SSHed onto that machine yet.

– Saqib Ali
Jan 22 '15 at 20:42













@SaqibAli You can't SSH into a RDS instance.

– ceejayoz
Jan 22 '15 at 21:51





@SaqibAli You can't SSH into a RDS instance.

– ceejayoz
Jan 22 '15 at 21:51










2 Answers
2






active

oldest

votes


















18














RDS instances are managed by Amazon. As such, to prevent you from breaking things like replication, your users - even the root user you set up when you create the instance - will not have full superuser privileges.



http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html




When you create a DB instance, the master user system account that you create is assigned to the rds_superuser role. The rds_superuser role is a pre-defined Amazon RDS role similar to the PostgreSQL superuser role (customarily named postgres in local instances), but with some restrictions. As with the PostgreSQL superuser role, the rds_superuser role has the most privileges on your DB instance and you should not assign this role to users unless they need the most access to the DB instance.







share|improve this answer


















  • 1





    i can't backup my database without the super user flag using pg_dump. Is there a way around this with rds on aws?

    – chovy
    Nov 18 '18 at 5:57


















3














If you list your current permissions with du+ or dg+, you will notice you are not a superuser but only allowed permissions Create role, Create DB. As such you are not allowed to assign yourself permissions higher from the ones you are currently assigned with.



Normally you are not given root or superuser permissions in any hosted environment. I suggest you spin up a custom EC2 instance and install PostgreSQL locally for complete control.






share|improve this answer




















  • 1





    is there really no way to backup an amazon rds database with pg_dump otherwise?

    – chovy
    Nov 18 '18 at 5:58











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f661661%2fwhy-cant-i-create-a-superuser-in-aws-postgresql-instance%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









18














RDS instances are managed by Amazon. As such, to prevent you from breaking things like replication, your users - even the root user you set up when you create the instance - will not have full superuser privileges.



http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html




When you create a DB instance, the master user system account that you create is assigned to the rds_superuser role. The rds_superuser role is a pre-defined Amazon RDS role similar to the PostgreSQL superuser role (customarily named postgres in local instances), but with some restrictions. As with the PostgreSQL superuser role, the rds_superuser role has the most privileges on your DB instance and you should not assign this role to users unless they need the most access to the DB instance.







share|improve this answer


















  • 1





    i can't backup my database without the super user flag using pg_dump. Is there a way around this with rds on aws?

    – chovy
    Nov 18 '18 at 5:57















18














RDS instances are managed by Amazon. As such, to prevent you from breaking things like replication, your users - even the root user you set up when you create the instance - will not have full superuser privileges.



http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html




When you create a DB instance, the master user system account that you create is assigned to the rds_superuser role. The rds_superuser role is a pre-defined Amazon RDS role similar to the PostgreSQL superuser role (customarily named postgres in local instances), but with some restrictions. As with the PostgreSQL superuser role, the rds_superuser role has the most privileges on your DB instance and you should not assign this role to users unless they need the most access to the DB instance.







share|improve this answer


















  • 1





    i can't backup my database without the super user flag using pg_dump. Is there a way around this with rds on aws?

    – chovy
    Nov 18 '18 at 5:57













18












18








18







RDS instances are managed by Amazon. As such, to prevent you from breaking things like replication, your users - even the root user you set up when you create the instance - will not have full superuser privileges.



http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html




When you create a DB instance, the master user system account that you create is assigned to the rds_superuser role. The rds_superuser role is a pre-defined Amazon RDS role similar to the PostgreSQL superuser role (customarily named postgres in local instances), but with some restrictions. As with the PostgreSQL superuser role, the rds_superuser role has the most privileges on your DB instance and you should not assign this role to users unless they need the most access to the DB instance.







share|improve this answer













RDS instances are managed by Amazon. As such, to prevent you from breaking things like replication, your users - even the root user you set up when you create the instance - will not have full superuser privileges.



http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html




When you create a DB instance, the master user system account that you create is assigned to the rds_superuser role. The rds_superuser role is a pre-defined Amazon RDS role similar to the PostgreSQL superuser role (customarily named postgres in local instances), but with some restrictions. As with the PostgreSQL superuser role, the rds_superuser role has the most privileges on your DB instance and you should not assign this role to users unless they need the most access to the DB instance.








share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 22 '15 at 21:38









ceejayozceejayoz

27.1k66392




27.1k66392







  • 1





    i can't backup my database without the super user flag using pg_dump. Is there a way around this with rds on aws?

    – chovy
    Nov 18 '18 at 5:57












  • 1





    i can't backup my database without the super user flag using pg_dump. Is there a way around this with rds on aws?

    – chovy
    Nov 18 '18 at 5:57







1




1





i can't backup my database without the super user flag using pg_dump. Is there a way around this with rds on aws?

– chovy
Nov 18 '18 at 5:57





i can't backup my database without the super user flag using pg_dump. Is there a way around this with rds on aws?

– chovy
Nov 18 '18 at 5:57













3














If you list your current permissions with du+ or dg+, you will notice you are not a superuser but only allowed permissions Create role, Create DB. As such you are not allowed to assign yourself permissions higher from the ones you are currently assigned with.



Normally you are not given root or superuser permissions in any hosted environment. I suggest you spin up a custom EC2 instance and install PostgreSQL locally for complete control.






share|improve this answer




















  • 1





    is there really no way to backup an amazon rds database with pg_dump otherwise?

    – chovy
    Nov 18 '18 at 5:58















3














If you list your current permissions with du+ or dg+, you will notice you are not a superuser but only allowed permissions Create role, Create DB. As such you are not allowed to assign yourself permissions higher from the ones you are currently assigned with.



Normally you are not given root or superuser permissions in any hosted environment. I suggest you spin up a custom EC2 instance and install PostgreSQL locally for complete control.






share|improve this answer




















  • 1





    is there really no way to backup an amazon rds database with pg_dump otherwise?

    – chovy
    Nov 18 '18 at 5:58













3












3








3







If you list your current permissions with du+ or dg+, you will notice you are not a superuser but only allowed permissions Create role, Create DB. As such you are not allowed to assign yourself permissions higher from the ones you are currently assigned with.



Normally you are not given root or superuser permissions in any hosted environment. I suggest you spin up a custom EC2 instance and install PostgreSQL locally for complete control.






share|improve this answer















If you list your current permissions with du+ or dg+, you will notice you are not a superuser but only allowed permissions Create role, Create DB. As such you are not allowed to assign yourself permissions higher from the ones you are currently assigned with.



Normally you are not given root or superuser permissions in any hosted environment. I suggest you spin up a custom EC2 instance and install PostgreSQL locally for complete control.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 5 at 18:20









Dennis

1094




1094










answered Jan 18 '17 at 13:49









Gorazd ZagarGorazd Zagar

513




513







  • 1





    is there really no way to backup an amazon rds database with pg_dump otherwise?

    – chovy
    Nov 18 '18 at 5:58












  • 1





    is there really no way to backup an amazon rds database with pg_dump otherwise?

    – chovy
    Nov 18 '18 at 5:58







1




1





is there really no way to backup an amazon rds database with pg_dump otherwise?

– chovy
Nov 18 '18 at 5:58





is there really no way to backup an amazon rds database with pg_dump otherwise?

– chovy
Nov 18 '18 at 5:58

















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f661661%2fwhy-cant-i-create-a-superuser-in-aws-postgresql-instance%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company