S
S
svd2222014-01-25 13:31:25
SFTP
svd222, 2014-01-25 13:31:25

Debian, there are 2 access via ssh - user1 and root, how to implement uploading files via sftp?

There is a dedicated Debian server, there are 2 access via ssh - user1 and root
The server is configured in such a way that I can only connect remotely on behalf of user1
and then su ... and I log in as root, I
need to upload files via sftp, how to do this ?
If I specify user1 connection parameters in the sftp settings, pass1 gives access denied when trying to upload files to the server.
Linux administration is not strong.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Klementiev, 2014-01-25
@svd222

If the SFTP connection itself is normal, then you are trying to upload files to a directory that does not belong to user1 or user1 does not have write access to it. When connecting via SFTP, all actions with files will occur only from user1, so initially set the necessary rights to the directory where you will upload files via SSH using sudo.

sudo chown user1 /var/www/
sudo chmod 0755 /var/www/

K
kompi, 2014-01-25
@kompi

You will have to change the permissions each time if the folder is used not only by user1, for example, the www-data web server. Also www-data will not be able to upload files.
What is the main problem:
The server loads files from forms under www-data.
Something you sometimes try to change under root.
Trying to write under user1.
In your case it should be like this:
Owner of /var/www www-data with default permissions (to be configured) rwx-rwx-rx
root and user1 added to www-data group.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question