last day (102 days later) » 

5:40 PM
Hi Anwar. Thanks for jumping in on this
 
hi
 
What I posted in those comments is a fake password :) I don't know if it makes a difference what the password is tho no? I'm trying to make the variable not be processed as a string.
 
can you share the full script?
 
That was the full script :)
 
I ran it how?
 
5:42 PM
Then there is a var.src which has just one line:
JOHNPASSWORD=myc00lpassword
 
where was var.src?
 
i chmod +x the script then ./myscript.sh
 
ok.
 
var.src was in /
 
root ?
 
5:42 PM
Ya. Not /root but /
-rw-rw-rw- 1 root root 595 Aug 21 13:32 var.src
 
i'm checking it. how do you check user's password?
 
I manually enter it in the var.src
 
if user is created, how do you check his password is set to $JOHNPASSWORD
?
 
.
I am running owncloud which asks for a connection to the database and when I put in $JOHNPASSWORD it works but not myc00lpassword
I don't know how to check via commandline
hmmm I tried:
root@team:~# psql -d john -U john
psql: FATAL: Peer authentication failed for user "john"
 
it's not telling us that the password is not correct
 
5:50 PM
You're right
Maybe its in the pg_hba file
 
have you tried removing the ' around EOF on first line?
is that necessary?
 
/etc/postgresql/9.5/main/pg_hba.conf:
# Database administrative login by Unix domain socket
local all postgres peer

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 10.10.30.50/32 md5
host all all 127.0.0.1/32 md5
# IPv6 local connections:
I can try that.. Let me go see
 
check it
 
Same result if there is no quotes
 
hmm
 
5:56 PM
I think it's because I'm using heredoc EOF so it makes a subshell? So then how can it read this line:
ALTER USER john WITH PASSWORD '$JOHNPASSWORD';
Because ALTER PASSWORD needs a quote
But it's being processed rather than added as a string
 
let me check
 
This doesn't work also:
ALTER USER john WITH PASSWORD \'$JOHNPASSWORD\';
 
I go read it
No go :(
This is the command I was researching:
17
Q: How to create a user for Postgres from the command line for bash automation

TampaI am using Ubuntu 12.04 and Postgress 9.2. I need to create this user with this password e.g. postgres://admin:test101@127.0.0.1:5432 How to do that from the command line? I need to automate with a bash script. I have a fresh install.

 
It's around 12:03 AM here. I'll look at it tomorrow. need to go. bye
 
6:04 PM
But I need to change test101 to JOHNPASSWORD
Ok thanks for trying
Bye
 
you're welcome :)
bye
 

  last day (102 days later) »