Score:0

How do I create a samba share to var/www on Ubuntu and access it from windows machine?

in flag

OK, my server has 2 successfully shared folders that I use for personal stuff and backups, but I have to use the same username on my windows machine to that on my ubuntu box, now, here's the problem, to upload files to the web server root '/var/www/html' which has www-data:www-data ownership, I'm having to first zip up the web files, then using webmin to upload and uncompress the files, what I would like to do, is to use my windows box just as I do when I connect to my other shared folders to drag and drop, but because www-data:www-data has ownership of /var/www I can't connect from windows using that user, because windows says 'Unable to connect using specified credentials'.

Is there a way to connect from my windows box but using www-data as the username and presumably, www-data doesn't have a password? I don't want to keep creating new account on my windows box, because the more accounts created, the more space is used, I want to use the account I'm using right now, but login to the shared folder using www-data.

Score:0
in flag

For anyone that's interested and also has the same problem, I found the solution.

OK, people will say I shouldn't do this, but it's the ONLY way and it works, and that is to do this:

  1. login to my server using SSH

  2. perform these tasks:

    cd /var
    sudo chown -R <username>:<usergroup> www
    

The username and usergroup should be the same as the user account in Windows (eg. tom:tom)

Then create the samba share allowing local access to the same user name as my windows box, then connect to it from Windows, drag and drop the needed web files, disconnect share, return to the console and reverse the previous process, but using www-data:www-data instead of username:usergroup.

The simplest methods always work, but if there's a security risk doing this, then there is no other way.

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.