OpenSSH does not work for a Ubuntu I server configured

I just installed the ubuntu server using this tutorial. I can connect to SSH perfectly, but when I try to move things to the server, I get this error:

Permission denied (SSH_FX_PERMISSION_DENIED: The user does not have sufficient permissions to perform the operation.). 

I know that I was doing something like

 sudo usermod -g www-data [MY USERNAME] sudo chown -R www-data:www-data /var/www sudo chmod -R 775 /var/www 

So I have no idea why it is not working. Can anyone suggest suggestions?

+4
source share
4 answers

To copy files:

 scp myfiles.zip myusername@mywebserver.com : 

Now log in and copy the files to / var / www

 ssh -l myusername mywebserver.com unzip myfiles.zip sudo cp myfiles/* /var/www 

You need sudo to put the files in a directory that belongs to www data. If you want to avoid sudo, you will need to configure www data as real usernames with a password, and their home directory is set to / var / www. Then you can move individual files using scp and not register with ssh.

+2
source
 sudo chown -R www-data:www-data sudo chmod -R 775 /var/www 

change www data to any user with whom you are logged in. In my case, it was ubuntu.

+1
source

This is simply a file permissions error. The user you are connecting to with cyberduck does not have permission to perform file operations.

It is a good idea to try a similar SCP operation on the command line to double check that cyberduck is not playing tricks on you. Here you will see a quick "permission denied" error.

Make sure you connect as www data if the user who owns the file ... although it may be unusual to connect to this user. Alternatives? Log in as root. Try writing files to a different destination directory, for example. your user home directory or / tmp. This may be an adequate workaround if you can move the files after they are transferred, but in any case run this test as a health check.

Personally, I got into this error with one specific file, because I accidentally ran root to become the owner of the file itself (and not the directory in which it was), but your -R commands should take care of this.

Another piece of information I remember hit a bit: do you have SELinux?

0
source
  • sudo groupadd vivek
  • sudo useradd -g vivek -G www-data vivek
  • sudo passwd vivek
  • sudo chown -R www-data: www-data / var / www
  • sudo chmod -R 775 / var / www

In your usermod, Capital G is important -G because I did what you did and corrected my ftp error. I think you have configured the group relation incorrectly

0
source

All Articles