Score:0

Permission denied (publickey,password) Apache in Ubuntu 20.04LTS

cn flag

I obtain the above mentioned error "Permission denied (publickey,password)" when trying to connect with ssh using my apache server. The framework I have used is Django and when deploying it locally (with python) the ssh communication works perfectly. However, when I deploy it with apache on every ssh, scp communication I obtain the error.

This is what I have tried so far:

  1. Proper ssh key. It asks me for the passphrase the first time I connect via terminal or with the py deployment server

  2. Permission of ~/.ssh folder is 700, ~/.ssh/id_rsa is 600, and ~/.ssh/id_rsa.pub is 644

  3. I have changed both the owner of the key to www-data and the user of apache to my sudo

  4. Disabled password authentication on the server

Any help is much appreciated!

uz flag
Jos
Use `ssh -v` or even `ssh -v -v` to get more details of the failing login procedure.
Angel del Pino avatar
cn flag
Thanks. I tried and what I obtained is `debug1: read_passphrase: can't open /dev/tty: No such device or address`. I was thinking that client is unable to open a terminal device to read the passphrase for the private key, therefore I added the key manually by `eval "$(ssh-agent -s)" ssh-add /path/to/private_key`, but the problem still persists. Do you know if there is any way to run this command alongside Apache?
uz flag
Jos
See [this](https://serverfault.com/questions/251876/debug1-read-passphrase-cant-open-dev-tty-no-such-device-or-address-when-t). What does `ls -la /dev/tty` show?
Angel del Pino avatar
cn flag
According to the post above mentioned, I obtain the correct permissions `crw-rw-rw- 1 root tty 5, 0 Feb 14 09:35 /dev/tty`. I have even changed the owner of the `tty` folder from `root` to the apache service `www-data`, and still not working
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.