13

I am running Ubuntu on a Oracle Vbox in Windows 7 to develop a website. I have a set of directories that have owner read/write permissions but the group www-data does not have rights on the directories.

I tried the command sudo chmod 640 /path-to-directory to change the status, but receive a message requesting my www-data password. My owner level password does not work and I do not know what this password might be.

I tried passwd and receive the message 'changing the password for www-data and a prompt for my current password. When I enter it, I get this error message:

passwd: Authentication token manipulation error
passwd: password unchanged

This error message looks more like some sort of problem on my system, but everything else works fine.

Flyk
  • 1,480
  • 3
  • 18
  • 24
Ashlar
  • 965

3 Answers3

20

You're doing it wrong (tm) :)

In your terminal window, look at the "command prompt":

username@hostname:~$

What is username there? You can also try entering whoami[Enter] to see your current username.

From you description it looks like you entered something like

sudo su www-data

or somehow else opened a console session as www-data user. This user has no rights to use sudo command, so your attempts at using sudo fail.

www-data user also has no password set by default, so it is impossible to log in directly as this user. Which is good. You do not want to give it a password.

You need to open another session as your user (or exit your current www-data session) and type the commands there:

sudo chown yourusername:www-data /path/to/directory

which will ask you for your login password.

(or, maybe, just move your stuff to /var/www which already has correct permissions. Then you can add your user to www-data group to get read-write privileges to that directory)

Sergey
  • 44,353
3

To allow user www-data to login with WinSCP in a local vmware running ubuntu follow these steps:

  1. Edit the password file

    sudo nano /etc/passwd
    
  2. Alter

    www-data:x:33:33:www-data:/bin:/usr/sbin/nologin
    
  3. to

    www-data:x:33:33:www-data:/var/www:/bin/bash
    
  4. Save.

  5. Set the password for www-data

    sudo passwd www-data
    
  6. You can now login using www-data user.

-1

To change password use this command sudo passwd username ,change username with user you want to set new password,but also you should check ownership and group of particular directory. Use this command ls -l /path/to/file #the third field in the ls -l output is the user and the fourth is the group

You can change group and ownership with chown

Sanel
  • 1