Score:0

Connect to remote SSH with www-data user

fr flag

I want to open an SSH tunnel between one machine and another. I don't have root access on the first machine, only access to the www-data account. When I try to open an SSH tunnel to a second machine, I get the following error:

Pseudo-terminal will not be allocated because stdin is not a terminal. Could not create directory '/var/www/.ssh'. Warning: Permanently added '212.234.53.19' (ECDSA) to the list of known hosts. Permission denied, please try again. Permission denied, please try again. [email protected]: Permission denied (publickey,password).

Is it possible to specify a folder where my user www-data has write permission instead of /var/www?

Thank you very much

in flag
The Error in that message is that the permission is denied to log into the remote server. You need to provide a valid private key.
Sagaroth avatar
fr flag
So I have to get the key of my remote server and then specify it during the SSH connection? Is it possible to specify another location?
in flag
Of course. Read the manual of the ssh client.
Sagaroth avatar
fr flag
The problem is that I am not on a machine where I am root. And even if I temporarily change the HOME of my www-data user to point to a folder where I have write permissions, I still get a "Could not create directory '/var/www/.ssh'" error when I try to connect to my remot
us flag
You should not use `www-data` account for other purposes than running web servers. Create a dedicated user account for the tunnel purpose.
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.