Share ubuntu-server 16.04 folder to windows host“Failed to mount Windows share” error in SambaHow to...
Why won't the strings command stop?
Should I use HTTPS on a domain that will only be used for redirection?
Can a space-faring robot still function over a billion years?
Is there a math equivalent to the conditional ternary operator?
An Undercover Army
If nine coins are tossed, what is the probability that the number of heads is even?
Was it really inappropriate to write a pull request for the company I interviewed with?
How to disable or uninstall iTunes under High Sierra without disabling SIP
A bug in Excel? Conditional formatting for marking duplicates also highlights unique value
Why is it "take a leak?"
How can I be pwned if I'm not registered on the compromised site?
Draw bounding region by list of points
I can't die. Who am I?
GPL code private and stolen
How do I deal with being envious of my own players?
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
What can I do if someone tampers with my SSH public key?
The Ohm's law calculations of the parts do not agree with the whole
Can we carry rice to Japan?
What is better: yes / no radio, or simple checkbox?
Difference between 'stomach' and 'uterus'
How to kill a localhost:8080
How to fix my table, centering of columns
How does insurance birth control work?
Share ubuntu-server 16.04 folder to windows host
“Failed to mount Windows share” error in SambaHow to setup file sharing for a noobieUbuntu server machine doesn't seem to be discoverable on network from another Linux machinemap ubuntu shared folder in windows 7How do I share a folder with another Linux machine on the same home network?Share between Ubuntu machinesSetup LAN connection with Windows GuestShare a folder from UBUNTUtrying to connect ubuntu with windows xp using samba serverUbuntu 16.04 / Samba Network Share Disconnecting during Windows Server Backupubuntu 16.04 samba not connecting to windows 7Share folder using samba but cannot have full access other than rootUnable to get shared folder from windows server (in LAN) : getting empty folderNeed help in configuring share folder
I have installed the ubuntu-server 16.04 and VBoxLinuxadditions and Samba
I am trying to share a folder from this server to my windows host machine.
Now I can see this virtual server on my network but there are no shared folders on the server.
How do I make one through the command line?
server samba
add a comment |
I have installed the ubuntu-server 16.04 and VBoxLinuxadditions and Samba
I am trying to share a folder from this server to my windows host machine.
Now I can see this virtual server on my network but there are no shared folders on the server.
How do I make one through the command line?
server samba
This answer has a very easy to follow step by step command line setup.
– L. D. James
Apr 8 '17 at 15:14
TNX i will check that out now
– lewis4u
Apr 8 '17 at 15:19
Extremely easy if you manually install samba and ?-share if the system fails to install them automatically. See my answer below.
– Papou
May 30 '18 at 20:51
add a comment |
I have installed the ubuntu-server 16.04 and VBoxLinuxadditions and Samba
I am trying to share a folder from this server to my windows host machine.
Now I can see this virtual server on my network but there are no shared folders on the server.
How do I make one through the command line?
server samba
I have installed the ubuntu-server 16.04 and VBoxLinuxadditions and Samba
I am trying to share a folder from this server to my windows host machine.
Now I can see this virtual server on my network but there are no shared folders on the server.
How do I make one through the command line?
server samba
server samba
asked Apr 8 '17 at 15:05
lewis4ulewis4u
2,40831529
2,40831529
This answer has a very easy to follow step by step command line setup.
– L. D. James
Apr 8 '17 at 15:14
TNX i will check that out now
– lewis4u
Apr 8 '17 at 15:19
Extremely easy if you manually install samba and ?-share if the system fails to install them automatically. See my answer below.
– Papou
May 30 '18 at 20:51
add a comment |
This answer has a very easy to follow step by step command line setup.
– L. D. James
Apr 8 '17 at 15:14
TNX i will check that out now
– lewis4u
Apr 8 '17 at 15:19
Extremely easy if you manually install samba and ?-share if the system fails to install them automatically. See my answer below.
– Papou
May 30 '18 at 20:51
This answer has a very easy to follow step by step command line setup.
– L. D. James
Apr 8 '17 at 15:14
This answer has a very easy to follow step by step command line setup.
– L. D. James
Apr 8 '17 at 15:14
TNX i will check that out now
– lewis4u
Apr 8 '17 at 15:19
TNX i will check that out now
– lewis4u
Apr 8 '17 at 15:19
Extremely easy if you manually install samba and ?-share if the system fails to install them automatically. See my answer below.
– Papou
May 30 '18 at 20:51
Extremely easy if you manually install samba and ?-share if the system fails to install them automatically. See my answer below.
– Papou
May 30 '18 at 20:51
add a comment |
4 Answers
4
active
oldest
votes
So i have figured this on my own and this is the easiest solution:
just install samba with
sudo apt install samba
and go to this file:
/etc/samba/smb.conf
and just at the bottom add these lines:
[share]
comment = Ubuntu File Server Share
path = /path/to/the/folder #for example /home/user_name/public <- this comment needs to be deleted!
browsable = yes
guest ok = yes
read only = no
create mask = 0755
restart the samba service
sudo service smbd restart
sudo service nmbd restart
and that's it, easy peasy :)
What to do next? Where to find the shared folder from the client machine?
– Mohammed Joraid
Jul 19 '17 at 9:35
Just browse the network in Windows and it should be there after restart.
– lewis4u
Aug 21 '17 at 20:58
didn't work... using Ubuntu 16 LTS
– Mohammed Sufian
Oct 17 '17 at 15:18
I added /home folder as a [share]. After samba restart, I indeed see the "share" folder in Network \myBuntuServer but when I try to open it, I get "Windows cannot access \myBuntuServershare. The network name cannot be found". I found why - the first is, you cannot leave the # comments in the line with the folder name and the second is - the folder you share withguest ok
should have anonymous permissions set ( 777 )
– JustAMartin
Dec 1 '17 at 11:12
1
I question the use of "easy peasy" to describe Samba.
– nobar
Mar 10 '18 at 17:56
|
show 1 more comment
To add a share that is accessible by all users.
Create the directory for sharing the files and change the owner to the users group.
sudo mkdir -p /srv/samba/
sudo chown -R root:users /srv/samba/ [brusgroup][financial]
sudo chmod -R ug+rwx,o+rx-w /srv/samba/
Adding and managing users
eg. for group users
and user mattu
:
useradd mattu -m -G users
passwd mattu
sudo usermod -aG users mattu
Set a password for mattu
passwd mattu
Enter the password for the new user
Now add the user to the Samba user database.
sudo smbpasswd -a mattu
Enter the password for the new user
Edit the /etc/samba/smb.conf file
sudo vi /etc/samba/smb.conf
add the following lines and save the file
[allusers]
comment = All Users
path = /srv/samba/allusers/
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes
If all users shall be able to read and write to their home directories via Samba, edit the /etc/samba/smb.conf file and remove all lines. In vim:
- Type
gg
to move the cursor to the first line of the file, if it is not already there. - Type
dG
to delete all the lines.
Now you should be able to log in from your Windows workstation with the file explorer using username ruchi and the chosen password and store files on the ubuntu server either in ruchi's home directory or in the public shared directory.
[global]
workgroup = WORKGROUP
#netbios name = [FRODO]
passdb backend = tdbsam
printcap name = cups
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/groupmod -A %u %g
delete user from group script = /usr/sbin/groupmod -R %u %g
add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody %u
# Note: The following specifies the default logon script.
# Per user logon scripts can be specified in the user account using pdbedit
logon script = scriptslogon.bat
# This sets the default profile path. Set per user paths with pdbedit
logon path = \%LProfiles%U
logon drive = H:
logon home = \%L%U
domain logons = Yes
os level = 35
preferred master = Yes
domain master = Yes
#[deprecated thus change
#idmap uid = 15000-20000
#idmap gid = 15000-20000
#]
#[
idmap config * : backend = tdb
idmap config * : range = 10001-20000
idmap config DOMAIN : backend = rid
idmap config DOMAIN : range = 10000-20000
idmap config DOMAIN : base_rid = 0
#]
printing = cups
Example 2.8. Engineering Office smb.conf (shares and services)
[homes]
comment = Home Directories
valid users = %S
read only = No
browseable = No
# Printing auto-share (makes printers available thru CUPS)
[printers]
comment = All Printers
path = /var/spool/samba
printer admin = root, maryo
create mask = 0600
guest ok = Yes
printable = Yes
browseable = No
[print$]
comment = Printer Drivers Share
path = /var/lib/samba/drivers
write list = maryo, root
printer admin = maryo, root
# Needed to support domain logons
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
admin users = root, maryo
guest ok = Yes
browseable = No
# For profiles to work, create a user directory under the path
# shown. i.e., mkdir -p /var/lib/samba/profiles/maryo
[Profiles]
comment = Roaming Profile Share
path = /var/lib/samba/profiles
read only = No
profile acls = Yes
add a comment |
All you have to do to share folders with SMB is
depending on the file manager you use, make sure nautilus-share or caja-share or ?-share is installed to enable next step
right-click on the folder and select the [Properties ->] Share tab that the file manager should provide
if that step doesn't propose to do it, install samba manually
choose the right sharing options and click Share
see https://help.ubuntu.com/community/Samba/SambaServerGuide#Ubuntu_Server
add a comment |
I am using above commands to share folders from ubuntu to windows.
It works gracefully.
But there is a problem, It times out after a while.
Is there any way to add shared folders to samba configuration permanently.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f901583%2fshare-ubuntu-server-16-04-folder-to-windows-host%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
So i have figured this on my own and this is the easiest solution:
just install samba with
sudo apt install samba
and go to this file:
/etc/samba/smb.conf
and just at the bottom add these lines:
[share]
comment = Ubuntu File Server Share
path = /path/to/the/folder #for example /home/user_name/public <- this comment needs to be deleted!
browsable = yes
guest ok = yes
read only = no
create mask = 0755
restart the samba service
sudo service smbd restart
sudo service nmbd restart
and that's it, easy peasy :)
What to do next? Where to find the shared folder from the client machine?
– Mohammed Joraid
Jul 19 '17 at 9:35
Just browse the network in Windows and it should be there after restart.
– lewis4u
Aug 21 '17 at 20:58
didn't work... using Ubuntu 16 LTS
– Mohammed Sufian
Oct 17 '17 at 15:18
I added /home folder as a [share]. After samba restart, I indeed see the "share" folder in Network \myBuntuServer but when I try to open it, I get "Windows cannot access \myBuntuServershare. The network name cannot be found". I found why - the first is, you cannot leave the # comments in the line with the folder name and the second is - the folder you share withguest ok
should have anonymous permissions set ( 777 )
– JustAMartin
Dec 1 '17 at 11:12
1
I question the use of "easy peasy" to describe Samba.
– nobar
Mar 10 '18 at 17:56
|
show 1 more comment
So i have figured this on my own and this is the easiest solution:
just install samba with
sudo apt install samba
and go to this file:
/etc/samba/smb.conf
and just at the bottom add these lines:
[share]
comment = Ubuntu File Server Share
path = /path/to/the/folder #for example /home/user_name/public <- this comment needs to be deleted!
browsable = yes
guest ok = yes
read only = no
create mask = 0755
restart the samba service
sudo service smbd restart
sudo service nmbd restart
and that's it, easy peasy :)
What to do next? Where to find the shared folder from the client machine?
– Mohammed Joraid
Jul 19 '17 at 9:35
Just browse the network in Windows and it should be there after restart.
– lewis4u
Aug 21 '17 at 20:58
didn't work... using Ubuntu 16 LTS
– Mohammed Sufian
Oct 17 '17 at 15:18
I added /home folder as a [share]. After samba restart, I indeed see the "share" folder in Network \myBuntuServer but when I try to open it, I get "Windows cannot access \myBuntuServershare. The network name cannot be found". I found why - the first is, you cannot leave the # comments in the line with the folder name and the second is - the folder you share withguest ok
should have anonymous permissions set ( 777 )
– JustAMartin
Dec 1 '17 at 11:12
1
I question the use of "easy peasy" to describe Samba.
– nobar
Mar 10 '18 at 17:56
|
show 1 more comment
So i have figured this on my own and this is the easiest solution:
just install samba with
sudo apt install samba
and go to this file:
/etc/samba/smb.conf
and just at the bottom add these lines:
[share]
comment = Ubuntu File Server Share
path = /path/to/the/folder #for example /home/user_name/public <- this comment needs to be deleted!
browsable = yes
guest ok = yes
read only = no
create mask = 0755
restart the samba service
sudo service smbd restart
sudo service nmbd restart
and that's it, easy peasy :)
So i have figured this on my own and this is the easiest solution:
just install samba with
sudo apt install samba
and go to this file:
/etc/samba/smb.conf
and just at the bottom add these lines:
[share]
comment = Ubuntu File Server Share
path = /path/to/the/folder #for example /home/user_name/public <- this comment needs to be deleted!
browsable = yes
guest ok = yes
read only = no
create mask = 0755
restart the samba service
sudo service smbd restart
sudo service nmbd restart
and that's it, easy peasy :)
edited Feb 15 '18 at 9:54
answered Apr 8 '17 at 21:46
lewis4ulewis4u
2,40831529
2,40831529
What to do next? Where to find the shared folder from the client machine?
– Mohammed Joraid
Jul 19 '17 at 9:35
Just browse the network in Windows and it should be there after restart.
– lewis4u
Aug 21 '17 at 20:58
didn't work... using Ubuntu 16 LTS
– Mohammed Sufian
Oct 17 '17 at 15:18
I added /home folder as a [share]. After samba restart, I indeed see the "share" folder in Network \myBuntuServer but when I try to open it, I get "Windows cannot access \myBuntuServershare. The network name cannot be found". I found why - the first is, you cannot leave the # comments in the line with the folder name and the second is - the folder you share withguest ok
should have anonymous permissions set ( 777 )
– JustAMartin
Dec 1 '17 at 11:12
1
I question the use of "easy peasy" to describe Samba.
– nobar
Mar 10 '18 at 17:56
|
show 1 more comment
What to do next? Where to find the shared folder from the client machine?
– Mohammed Joraid
Jul 19 '17 at 9:35
Just browse the network in Windows and it should be there after restart.
– lewis4u
Aug 21 '17 at 20:58
didn't work... using Ubuntu 16 LTS
– Mohammed Sufian
Oct 17 '17 at 15:18
I added /home folder as a [share]. After samba restart, I indeed see the "share" folder in Network \myBuntuServer but when I try to open it, I get "Windows cannot access \myBuntuServershare. The network name cannot be found". I found why - the first is, you cannot leave the # comments in the line with the folder name and the second is - the folder you share withguest ok
should have anonymous permissions set ( 777 )
– JustAMartin
Dec 1 '17 at 11:12
1
I question the use of "easy peasy" to describe Samba.
– nobar
Mar 10 '18 at 17:56
What to do next? Where to find the shared folder from the client machine?
– Mohammed Joraid
Jul 19 '17 at 9:35
What to do next? Where to find the shared folder from the client machine?
– Mohammed Joraid
Jul 19 '17 at 9:35
Just browse the network in Windows and it should be there after restart.
– lewis4u
Aug 21 '17 at 20:58
Just browse the network in Windows and it should be there after restart.
– lewis4u
Aug 21 '17 at 20:58
didn't work... using Ubuntu 16 LTS
– Mohammed Sufian
Oct 17 '17 at 15:18
didn't work... using Ubuntu 16 LTS
– Mohammed Sufian
Oct 17 '17 at 15:18
I added /home folder as a [share]. After samba restart, I indeed see the "share" folder in Network \myBuntuServer but when I try to open it, I get "Windows cannot access \myBuntuServershare. The network name cannot be found". I found why - the first is, you cannot leave the # comments in the line with the folder name and the second is - the folder you share with
guest ok
should have anonymous permissions set ( 777 )– JustAMartin
Dec 1 '17 at 11:12
I added /home folder as a [share]. After samba restart, I indeed see the "share" folder in Network \myBuntuServer but when I try to open it, I get "Windows cannot access \myBuntuServershare. The network name cannot be found". I found why - the first is, you cannot leave the # comments in the line with the folder name and the second is - the folder you share with
guest ok
should have anonymous permissions set ( 777 )– JustAMartin
Dec 1 '17 at 11:12
1
1
I question the use of "easy peasy" to describe Samba.
– nobar
Mar 10 '18 at 17:56
I question the use of "easy peasy" to describe Samba.
– nobar
Mar 10 '18 at 17:56
|
show 1 more comment
To add a share that is accessible by all users.
Create the directory for sharing the files and change the owner to the users group.
sudo mkdir -p /srv/samba/
sudo chown -R root:users /srv/samba/ [brusgroup][financial]
sudo chmod -R ug+rwx,o+rx-w /srv/samba/
Adding and managing users
eg. for group users
and user mattu
:
useradd mattu -m -G users
passwd mattu
sudo usermod -aG users mattu
Set a password for mattu
passwd mattu
Enter the password for the new user
Now add the user to the Samba user database.
sudo smbpasswd -a mattu
Enter the password for the new user
Edit the /etc/samba/smb.conf file
sudo vi /etc/samba/smb.conf
add the following lines and save the file
[allusers]
comment = All Users
path = /srv/samba/allusers/
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes
If all users shall be able to read and write to their home directories via Samba, edit the /etc/samba/smb.conf file and remove all lines. In vim:
- Type
gg
to move the cursor to the first line of the file, if it is not already there. - Type
dG
to delete all the lines.
Now you should be able to log in from your Windows workstation with the file explorer using username ruchi and the chosen password and store files on the ubuntu server either in ruchi's home directory or in the public shared directory.
[global]
workgroup = WORKGROUP
#netbios name = [FRODO]
passdb backend = tdbsam
printcap name = cups
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/groupmod -A %u %g
delete user from group script = /usr/sbin/groupmod -R %u %g
add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody %u
# Note: The following specifies the default logon script.
# Per user logon scripts can be specified in the user account using pdbedit
logon script = scriptslogon.bat
# This sets the default profile path. Set per user paths with pdbedit
logon path = \%LProfiles%U
logon drive = H:
logon home = \%L%U
domain logons = Yes
os level = 35
preferred master = Yes
domain master = Yes
#[deprecated thus change
#idmap uid = 15000-20000
#idmap gid = 15000-20000
#]
#[
idmap config * : backend = tdb
idmap config * : range = 10001-20000
idmap config DOMAIN : backend = rid
idmap config DOMAIN : range = 10000-20000
idmap config DOMAIN : base_rid = 0
#]
printing = cups
Example 2.8. Engineering Office smb.conf (shares and services)
[homes]
comment = Home Directories
valid users = %S
read only = No
browseable = No
# Printing auto-share (makes printers available thru CUPS)
[printers]
comment = All Printers
path = /var/spool/samba
printer admin = root, maryo
create mask = 0600
guest ok = Yes
printable = Yes
browseable = No
[print$]
comment = Printer Drivers Share
path = /var/lib/samba/drivers
write list = maryo, root
printer admin = maryo, root
# Needed to support domain logons
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
admin users = root, maryo
guest ok = Yes
browseable = No
# For profiles to work, create a user directory under the path
# shown. i.e., mkdir -p /var/lib/samba/profiles/maryo
[Profiles]
comment = Roaming Profile Share
path = /var/lib/samba/profiles
read only = No
profile acls = Yes
add a comment |
To add a share that is accessible by all users.
Create the directory for sharing the files and change the owner to the users group.
sudo mkdir -p /srv/samba/
sudo chown -R root:users /srv/samba/ [brusgroup][financial]
sudo chmod -R ug+rwx,o+rx-w /srv/samba/
Adding and managing users
eg. for group users
and user mattu
:
useradd mattu -m -G users
passwd mattu
sudo usermod -aG users mattu
Set a password for mattu
passwd mattu
Enter the password for the new user
Now add the user to the Samba user database.
sudo smbpasswd -a mattu
Enter the password for the new user
Edit the /etc/samba/smb.conf file
sudo vi /etc/samba/smb.conf
add the following lines and save the file
[allusers]
comment = All Users
path = /srv/samba/allusers/
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes
If all users shall be able to read and write to their home directories via Samba, edit the /etc/samba/smb.conf file and remove all lines. In vim:
- Type
gg
to move the cursor to the first line of the file, if it is not already there. - Type
dG
to delete all the lines.
Now you should be able to log in from your Windows workstation with the file explorer using username ruchi and the chosen password and store files on the ubuntu server either in ruchi's home directory or in the public shared directory.
[global]
workgroup = WORKGROUP
#netbios name = [FRODO]
passdb backend = tdbsam
printcap name = cups
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/groupmod -A %u %g
delete user from group script = /usr/sbin/groupmod -R %u %g
add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody %u
# Note: The following specifies the default logon script.
# Per user logon scripts can be specified in the user account using pdbedit
logon script = scriptslogon.bat
# This sets the default profile path. Set per user paths with pdbedit
logon path = \%LProfiles%U
logon drive = H:
logon home = \%L%U
domain logons = Yes
os level = 35
preferred master = Yes
domain master = Yes
#[deprecated thus change
#idmap uid = 15000-20000
#idmap gid = 15000-20000
#]
#[
idmap config * : backend = tdb
idmap config * : range = 10001-20000
idmap config DOMAIN : backend = rid
idmap config DOMAIN : range = 10000-20000
idmap config DOMAIN : base_rid = 0
#]
printing = cups
Example 2.8. Engineering Office smb.conf (shares and services)
[homes]
comment = Home Directories
valid users = %S
read only = No
browseable = No
# Printing auto-share (makes printers available thru CUPS)
[printers]
comment = All Printers
path = /var/spool/samba
printer admin = root, maryo
create mask = 0600
guest ok = Yes
printable = Yes
browseable = No
[print$]
comment = Printer Drivers Share
path = /var/lib/samba/drivers
write list = maryo, root
printer admin = maryo, root
# Needed to support domain logons
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
admin users = root, maryo
guest ok = Yes
browseable = No
# For profiles to work, create a user directory under the path
# shown. i.e., mkdir -p /var/lib/samba/profiles/maryo
[Profiles]
comment = Roaming Profile Share
path = /var/lib/samba/profiles
read only = No
profile acls = Yes
add a comment |
To add a share that is accessible by all users.
Create the directory for sharing the files and change the owner to the users group.
sudo mkdir -p /srv/samba/
sudo chown -R root:users /srv/samba/ [brusgroup][financial]
sudo chmod -R ug+rwx,o+rx-w /srv/samba/
Adding and managing users
eg. for group users
and user mattu
:
useradd mattu -m -G users
passwd mattu
sudo usermod -aG users mattu
Set a password for mattu
passwd mattu
Enter the password for the new user
Now add the user to the Samba user database.
sudo smbpasswd -a mattu
Enter the password for the new user
Edit the /etc/samba/smb.conf file
sudo vi /etc/samba/smb.conf
add the following lines and save the file
[allusers]
comment = All Users
path = /srv/samba/allusers/
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes
If all users shall be able to read and write to their home directories via Samba, edit the /etc/samba/smb.conf file and remove all lines. In vim:
- Type
gg
to move the cursor to the first line of the file, if it is not already there. - Type
dG
to delete all the lines.
Now you should be able to log in from your Windows workstation with the file explorer using username ruchi and the chosen password and store files on the ubuntu server either in ruchi's home directory or in the public shared directory.
[global]
workgroup = WORKGROUP
#netbios name = [FRODO]
passdb backend = tdbsam
printcap name = cups
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/groupmod -A %u %g
delete user from group script = /usr/sbin/groupmod -R %u %g
add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody %u
# Note: The following specifies the default logon script.
# Per user logon scripts can be specified in the user account using pdbedit
logon script = scriptslogon.bat
# This sets the default profile path. Set per user paths with pdbedit
logon path = \%LProfiles%U
logon drive = H:
logon home = \%L%U
domain logons = Yes
os level = 35
preferred master = Yes
domain master = Yes
#[deprecated thus change
#idmap uid = 15000-20000
#idmap gid = 15000-20000
#]
#[
idmap config * : backend = tdb
idmap config * : range = 10001-20000
idmap config DOMAIN : backend = rid
idmap config DOMAIN : range = 10000-20000
idmap config DOMAIN : base_rid = 0
#]
printing = cups
Example 2.8. Engineering Office smb.conf (shares and services)
[homes]
comment = Home Directories
valid users = %S
read only = No
browseable = No
# Printing auto-share (makes printers available thru CUPS)
[printers]
comment = All Printers
path = /var/spool/samba
printer admin = root, maryo
create mask = 0600
guest ok = Yes
printable = Yes
browseable = No
[print$]
comment = Printer Drivers Share
path = /var/lib/samba/drivers
write list = maryo, root
printer admin = maryo, root
# Needed to support domain logons
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
admin users = root, maryo
guest ok = Yes
browseable = No
# For profiles to work, create a user directory under the path
# shown. i.e., mkdir -p /var/lib/samba/profiles/maryo
[Profiles]
comment = Roaming Profile Share
path = /var/lib/samba/profiles
read only = No
profile acls = Yes
To add a share that is accessible by all users.
Create the directory for sharing the files and change the owner to the users group.
sudo mkdir -p /srv/samba/
sudo chown -R root:users /srv/samba/ [brusgroup][financial]
sudo chmod -R ug+rwx,o+rx-w /srv/samba/
Adding and managing users
eg. for group users
and user mattu
:
useradd mattu -m -G users
passwd mattu
sudo usermod -aG users mattu
Set a password for mattu
passwd mattu
Enter the password for the new user
Now add the user to the Samba user database.
sudo smbpasswd -a mattu
Enter the password for the new user
Edit the /etc/samba/smb.conf file
sudo vi /etc/samba/smb.conf
add the following lines and save the file
[allusers]
comment = All Users
path = /srv/samba/allusers/
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes
If all users shall be able to read and write to their home directories via Samba, edit the /etc/samba/smb.conf file and remove all lines. In vim:
- Type
gg
to move the cursor to the first line of the file, if it is not already there. - Type
dG
to delete all the lines.
Now you should be able to log in from your Windows workstation with the file explorer using username ruchi and the chosen password and store files on the ubuntu server either in ruchi's home directory or in the public shared directory.
[global]
workgroup = WORKGROUP
#netbios name = [FRODO]
passdb backend = tdbsam
printcap name = cups
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/groupmod -A %u %g
delete user from group script = /usr/sbin/groupmod -R %u %g
add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody %u
# Note: The following specifies the default logon script.
# Per user logon scripts can be specified in the user account using pdbedit
logon script = scriptslogon.bat
# This sets the default profile path. Set per user paths with pdbedit
logon path = \%LProfiles%U
logon drive = H:
logon home = \%L%U
domain logons = Yes
os level = 35
preferred master = Yes
domain master = Yes
#[deprecated thus change
#idmap uid = 15000-20000
#idmap gid = 15000-20000
#]
#[
idmap config * : backend = tdb
idmap config * : range = 10001-20000
idmap config DOMAIN : backend = rid
idmap config DOMAIN : range = 10000-20000
idmap config DOMAIN : base_rid = 0
#]
printing = cups
Example 2.8. Engineering Office smb.conf (shares and services)
[homes]
comment = Home Directories
valid users = %S
read only = No
browseable = No
# Printing auto-share (makes printers available thru CUPS)
[printers]
comment = All Printers
path = /var/spool/samba
printer admin = root, maryo
create mask = 0600
guest ok = Yes
printable = Yes
browseable = No
[print$]
comment = Printer Drivers Share
path = /var/lib/samba/drivers
write list = maryo, root
printer admin = maryo, root
# Needed to support domain logons
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
admin users = root, maryo
guest ok = Yes
browseable = No
# For profiles to work, create a user directory under the path
# shown. i.e., mkdir -p /var/lib/samba/profiles/maryo
[Profiles]
comment = Roaming Profile Share
path = /var/lib/samba/profiles
read only = No
profile acls = Yes
edited Oct 25 '17 at 7:52
muru
1
1
answered Oct 25 '17 at 7:28
uttam hathiuttam hathi
11
11
add a comment |
add a comment |
All you have to do to share folders with SMB is
depending on the file manager you use, make sure nautilus-share or caja-share or ?-share is installed to enable next step
right-click on the folder and select the [Properties ->] Share tab that the file manager should provide
if that step doesn't propose to do it, install samba manually
choose the right sharing options and click Share
see https://help.ubuntu.com/community/Samba/SambaServerGuide#Ubuntu_Server
add a comment |
All you have to do to share folders with SMB is
depending on the file manager you use, make sure nautilus-share or caja-share or ?-share is installed to enable next step
right-click on the folder and select the [Properties ->] Share tab that the file manager should provide
if that step doesn't propose to do it, install samba manually
choose the right sharing options and click Share
see https://help.ubuntu.com/community/Samba/SambaServerGuide#Ubuntu_Server
add a comment |
All you have to do to share folders with SMB is
depending on the file manager you use, make sure nautilus-share or caja-share or ?-share is installed to enable next step
right-click on the folder and select the [Properties ->] Share tab that the file manager should provide
if that step doesn't propose to do it, install samba manually
choose the right sharing options and click Share
see https://help.ubuntu.com/community/Samba/SambaServerGuide#Ubuntu_Server
All you have to do to share folders with SMB is
depending on the file manager you use, make sure nautilus-share or caja-share or ?-share is installed to enable next step
right-click on the folder and select the [Properties ->] Share tab that the file manager should provide
if that step doesn't propose to do it, install samba manually
choose the right sharing options and click Share
see https://help.ubuntu.com/community/Samba/SambaServerGuide#Ubuntu_Server
answered May 30 '18 at 20:44
PapouPapou
7914
7914
add a comment |
add a comment |
I am using above commands to share folders from ubuntu to windows.
It works gracefully.
But there is a problem, It times out after a while.
Is there any way to add shared folders to samba configuration permanently.
New contributor
add a comment |
I am using above commands to share folders from ubuntu to windows.
It works gracefully.
But there is a problem, It times out after a while.
Is there any way to add shared folders to samba configuration permanently.
New contributor
add a comment |
I am using above commands to share folders from ubuntu to windows.
It works gracefully.
But there is a problem, It times out after a while.
Is there any way to add shared folders to samba configuration permanently.
New contributor
I am using above commands to share folders from ubuntu to windows.
It works gracefully.
But there is a problem, It times out after a while.
Is there any way to add shared folders to samba configuration permanently.
New contributor
New contributor
answered 8 mins ago
user2046230user2046230
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f901583%2fshare-ubuntu-server-16-04-folder-to-windows-host%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
This answer has a very easy to follow step by step command line setup.
– L. D. James
Apr 8 '17 at 15:14
TNX i will check that out now
– lewis4u
Apr 8 '17 at 15:19
Extremely easy if you manually install samba and ?-share if the system fails to install them automatically. See my answer below.
– Papou
May 30 '18 at 20:51