Allow root only to edit shared folder in samba











up vote
0
down vote

favorite












I am using below to allow root user to have full access to the samba shared by entering the password, however, it showing not accessible. What I want is that to the Website share the root user should full access and others shouldn't (no guest)



[global]
workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Entersnews*spassword:* %nn *Retypesnews*spassword:* %nn *passwordsupdatedssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes

[Website]
path = /var/www/html/
create mask = 0755
directory mask = 0755
writable = yes
browseable = yes
force user = root
valid users = root









share|improve this question









New contributor




ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Your smb.conf is not clear, and rules are missing. Check here: wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs
    – ajcg
    Nov 23 at 13:13










  • @ajcg the share works, I only want root should have access to Website shared folder. I don't have problem in sharing, it is only the website shared folder which I want to be secured and accessed through root user only with password.
    – ARH
    Nov 23 at 13:51










  • It's not clear. To protect the folder /var/www/html/folder_to_website you only need to put a passwd in apache or nginx, etc, (from 'root' if you only want 'root' access). Example: htpasswd -c /etc/apache2/.htpasswd $USER && apache2ctl configtest. And if you want to share the same folder in samba is for other users to have access to it, then only put which users will have access permission (valid users = foo or admin users = root ....) and set chmod / chown -R root:root /path_to_ folder
    – ajcg
    Nov 23 at 14:27

















up vote
0
down vote

favorite












I am using below to allow root user to have full access to the samba shared by entering the password, however, it showing not accessible. What I want is that to the Website share the root user should full access and others shouldn't (no guest)



[global]
workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Entersnews*spassword:* %nn *Retypesnews*spassword:* %nn *passwordsupdatedssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes

[Website]
path = /var/www/html/
create mask = 0755
directory mask = 0755
writable = yes
browseable = yes
force user = root
valid users = root









share|improve this question









New contributor




ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Your smb.conf is not clear, and rules are missing. Check here: wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs
    – ajcg
    Nov 23 at 13:13










  • @ajcg the share works, I only want root should have access to Website shared folder. I don't have problem in sharing, it is only the website shared folder which I want to be secured and accessed through root user only with password.
    – ARH
    Nov 23 at 13:51










  • It's not clear. To protect the folder /var/www/html/folder_to_website you only need to put a passwd in apache or nginx, etc, (from 'root' if you only want 'root' access). Example: htpasswd -c /etc/apache2/.htpasswd $USER && apache2ctl configtest. And if you want to share the same folder in samba is for other users to have access to it, then only put which users will have access permission (valid users = foo or admin users = root ....) and set chmod / chown -R root:root /path_to_ folder
    – ajcg
    Nov 23 at 14:27















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am using below to allow root user to have full access to the samba shared by entering the password, however, it showing not accessible. What I want is that to the Website share the root user should full access and others shouldn't (no guest)



[global]
workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Entersnews*spassword:* %nn *Retypesnews*spassword:* %nn *passwordsupdatedssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes

[Website]
path = /var/www/html/
create mask = 0755
directory mask = 0755
writable = yes
browseable = yes
force user = root
valid users = root









share|improve this question









New contributor




ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am using below to allow root user to have full access to the samba shared by entering the password, however, it showing not accessible. What I want is that to the Website share the root user should full access and others shouldn't (no guest)



[global]
workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Entersnews*spassword:* %nn *Retypesnews*spassword:* %nn *passwordsupdatedssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes

[Website]
path = /var/www/html/
create mask = 0755
directory mask = 0755
writable = yes
browseable = yes
force user = root
valid users = root






linux samba






share|improve this question









New contributor




ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 23 at 12:12









Jeff Schaller

36.9k1052121




36.9k1052121






New contributor




ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 23 at 9:45









ARH

1092




1092




New contributor




ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






ARH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Your smb.conf is not clear, and rules are missing. Check here: wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs
    – ajcg
    Nov 23 at 13:13










  • @ajcg the share works, I only want root should have access to Website shared folder. I don't have problem in sharing, it is only the website shared folder which I want to be secured and accessed through root user only with password.
    – ARH
    Nov 23 at 13:51










  • It's not clear. To protect the folder /var/www/html/folder_to_website you only need to put a passwd in apache or nginx, etc, (from 'root' if you only want 'root' access). Example: htpasswd -c /etc/apache2/.htpasswd $USER && apache2ctl configtest. And if you want to share the same folder in samba is for other users to have access to it, then only put which users will have access permission (valid users = foo or admin users = root ....) and set chmod / chown -R root:root /path_to_ folder
    – ajcg
    Nov 23 at 14:27




















  • Your smb.conf is not clear, and rules are missing. Check here: wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs
    – ajcg
    Nov 23 at 13:13










  • @ajcg the share works, I only want root should have access to Website shared folder. I don't have problem in sharing, it is only the website shared folder which I want to be secured and accessed through root user only with password.
    – ARH
    Nov 23 at 13:51










  • It's not clear. To protect the folder /var/www/html/folder_to_website you only need to put a passwd in apache or nginx, etc, (from 'root' if you only want 'root' access). Example: htpasswd -c /etc/apache2/.htpasswd $USER && apache2ctl configtest. And if you want to share the same folder in samba is for other users to have access to it, then only put which users will have access permission (valid users = foo or admin users = root ....) and set chmod / chown -R root:root /path_to_ folder
    – ajcg
    Nov 23 at 14:27


















Your smb.conf is not clear, and rules are missing. Check here: wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs
– ajcg
Nov 23 at 13:13




Your smb.conf is not clear, and rules are missing. Check here: wiki.samba.org/index.php/Setting_up_a_Share_Using_Windows_ACLs
– ajcg
Nov 23 at 13:13












@ajcg the share works, I only want root should have access to Website shared folder. I don't have problem in sharing, it is only the website shared folder which I want to be secured and accessed through root user only with password.
– ARH
Nov 23 at 13:51




@ajcg the share works, I only want root should have access to Website shared folder. I don't have problem in sharing, it is only the website shared folder which I want to be secured and accessed through root user only with password.
– ARH
Nov 23 at 13:51












It's not clear. To protect the folder /var/www/html/folder_to_website you only need to put a passwd in apache or nginx, etc, (from 'root' if you only want 'root' access). Example: htpasswd -c /etc/apache2/.htpasswd $USER && apache2ctl configtest. And if you want to share the same folder in samba is for other users to have access to it, then only put which users will have access permission (valid users = foo or admin users = root ....) and set chmod / chown -R root:root /path_to_ folder
– ajcg
Nov 23 at 14:27






It's not clear. To protect the folder /var/www/html/folder_to_website you only need to put a passwd in apache or nginx, etc, (from 'root' if you only want 'root' access). Example: htpasswd -c /etc/apache2/.htpasswd $USER && apache2ctl configtest. And if you want to share the same folder in samba is for other users to have access to it, then only put which users will have access permission (valid users = foo or admin users = root ....) and set chmod / chown -R root:root /path_to_ folder
– ajcg
Nov 23 at 14:27

















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






ARH is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483637%2fallow-root-only-to-edit-shared-folder-in-samba%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








ARH is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















ARH is a new contributor. Be nice, and check out our Code of Conduct.













ARH is a new contributor. Be nice, and check out our Code of Conduct.












ARH is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483637%2fallow-root-only-to-edit-shared-folder-in-samba%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre