what's up my name is technobo here for
troubleshoot and welcome back to another
video in this video i'll show you how to
mount a windows shared folder in linux
specifically debian distributions
including pop os which i'm currently
using and ubuntu what this is based off
of though of course this should work on
other db in it distros as well so to
begin i'll open up the terminal and
we'll be running a few commands here
you'll find these in the description
down below sudo apt-get install samba
samba client
cifs utils lib nss win bind and win bind
so suit apt to get install somber samba
client sifs utils lib nss win bind and
win bind then i'll hit enter
enter my sudo password and hit yes to
start the installation these are all the
packages that we'll be using in this
video now i'll go ahead and clear this
and we'll get started now that we have
everything installed in order to mount
the folder from our windows desktop or
anything else onto this device here we
need to create a folder that will be
mounted in place so i'll be showing a
folder called github from my desktop
computer so sudo
mkdir medium and i'll enter the folder
name here i'll be sharing a folder
called github so i'll call it github
here the name doesn't matter but you
will need to remember this later on of
course i'll also need to share this on
my desktop computer so in my documents
here i have this github folder with my
github repositories inside of it i'll be
sharing this so i can access it on my
linux computer in this case my linux
virtual machine i'll right click the
github folder properties and in here
i'll head across to the sharing tab
advanced sharing then tick share this
folder permissions
everyone full control and these two tick
boxes below it ok apply ok
and close now we've successfully shared
it from our computer onto the network in
this sharing tab here you'll find the
network path that we'll be using later
on you can copy this and save this of
course if you'd prefer you can also use
an ip address instead of a computer name
here but we'll get back there later so
now that we have the file shared let's
go ahead and mounted and connected on
linux here so let's enable sharing first
sudo nano ptc ns switch dot conf and hit
enter inside of this file here on the
hosts line i'm using the arrow keys to
navigate i'll hold ctrl and press the
right arrow to skip a whole bunch of
characters all the way to just before
dns then i'll insert wins wins and space
ctrl s to save the file ctrl x to quit
then i'll run sudo service networking
restart and hit enter now that the
networking driver has been restarted we
can back up our f-stab file where we'll
be permanently mounting this folder on
our computer getting it to appear
getting it to appear in the file manager
somewhere over here so i'll back up the
fstab file pseudo cp to copy slash etc
f-stab space etc
f-stab dot old after we've copied the
file which we can then restore at some
stage in the future using pseudo mv etc
stab
old
to etc f-stab though i won't be running
this now of course we need to create a
file that we can put our credentials in
to access later so for this i'll run
nano home techno which is my username
dot smb cred of course this can be any
file you want but i'll name it this just
remember where you put it in here i'll
enter username equals followed by my
windows username in this case technome
and password equals followed by my
windows password in plain text if you
use a domain or something else you'll
enter that here as well but for me it's
just a username and password to which
i'll enter my password and then hit ctrl
s to save the file and control x to exit
now that we've written our login details
into the file here we can run id techno
the current account name on this
computer and we'll see uid equals and
gid equals both of these are 1000 of
course if you're the only user it should
be 1000 by default now that we have
collected all of these and we've backed
up the fstab file we've created the
folder we've put in the credentials we
can actually get to mounting it properly
so sudo nano etc f-stab and enter now
we're going to edit this file here head
to the very bottom of this static file
system information file and we'll be
entering slash slash followed by the
address of your computer which can be
the ip address or of course the host
name as such forward slash the folder in
my case github then space media followed
by the folder's name that we created in
my case github cifs credentials
equals and now we're going to enter
quite a bit of information so we're
going to enter the folder so we're going
to enter the file that we saved our
credentials in that dot smb cred file
slash home slash techno slash smb cred
comma and then a bunch of other text
which you'll find in the description
down below as well so io char set equals
utf-8 comma gid equals followed by the
gid of your account in my case 1000
comma uid equals 1000 or whatever your
uid is comma file underscore mode equals
0
seven comma dir
underscore mode equals o triple seven
space zero space zero hit enter to go
into the next line just for easy access
control s and control x my mistake later
on here i ended a minus rather than an
equals so i'll save it close it
and then round sudo mount hyphen a
hopefully it should be able to mount
otherwise if you see something like this
you'll need to edit the file again and
instead of using our computer name we'll
instead use an ip address so
192.168.1.20
save
close and try to mount it again this
time you should see a pop-up at the top
of your computer and if you open up the
file manager inside of here you'll then
see github or whatever folder you added
down here and will be synced with your
windows desktop computer over the
network opening up files and folders
things work practically as they would
anywhere else we can create files edit
files and all that good stuff because we
gave ourselves full permission using 007
as the permission value nice and simple
or it can take quite a while to get here
but when you do it's nice and simple and
restarting your computer should
automatically link up as long as it's
there on the network now to add other
files and folders to this it's really
simple once you set it up the first time
all we need to do is sudo mkdir
medium and followed by the folder's name
then to actually add them we once again
need to sudo nano etc fstab all you need
to do is duplicate this line down here
and simply swap out the folder name here
and
over here it's as simple as that now
that we've mounted it it should stay
there practically forever and allow us
to use it as long as it's connected over
the same network and of course shared on
our windows computer firewalls and other
things can get in the way so do keep
that in mind but anyways that about
wraps it up for this video thank you for
watching money's been taken over here
for troubleshoot and i'll see you all
next time ciao
you