Samba – How-to (Linuxmint Debian)
First of all you need samba installed which it usually is by default. If it shouldn’t be installed please open a terminal now.
- $ sudo apt-get install samba
Now we’re going to work with the configuration of samba. Before you start, make sure that samba isn’t running. To make sure it isn’t running you can perform following command.
- $ sudo /etc/init.d/samba stop
The samba-config file can be found in /etc/samba/smb.conf. If you open the file already there you’ll see that it is a template. We’re going to use it as base for further configuration. It can be a good idea to make a backup of the file before you start.
- $ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf-orginal
To start the configuration we need to start an editor. Using gnome, use gedit and if you’re using kde, use kate or kwrite. If you prefer cli-enviroment nano and VIM will work just fine. I am going to use kate here.
- $ sudo kate /etc/samba/smb.conf
Now edit the file appropriate to your desired settings. Set workgroup and so on. When you’re finished remember to save the file of course. After that you need to start samba.
- $ sudo /etc/init.d/samba start
Now add yourself as an user. When you’re prompted for a password, use the same as you use for your login.
- $ sudo smbpasswd -L -a yourusername
$ sudo smbpasswd -L -e yourusername
If you need other users to be able to access the share you need to add them to your computer and to samba as well. Make sure you use the same windows username and password.
- $ sudo useradd -s /bin/true user2
$ sudo smbpasswd -L –a user2
$ sudo smbpasswd -L -e user2
The "-s /bin/true" in the first line prevents the users from being able to access the commandline of your linux box ("-s" stands for "shell Don't change that setting to a valid login-shell unless you really know what you are doing)