1/ Solution 1:
```bash
sudo -u postgres psql
```
```bash
\password postgres
```
2/ Solution 2:
Edit `/etc/postgresql/9.1/main/pg_hba.conf` (path will differ) and change:
```bash
local all all peer
local all all md5
```
Then restart the server:
```bash
sudo service postgresql restart
```