Samba Command Line Configuration on openSUSE |
Desktop - OpenSUSE |
All of the configuration that we made through YaST, and more can be actioned at the command line. For ease of management YaST is extremely useful. As with most GUIs though it will lack speed, automation and full control abilities. I always suggest using the GUI to begin your Linux Management but as you become more confident with the command line you will naturally migrate to the shell for further management.
The SAMBA configuration is stored with the /etc/samba directory and the main file is the smb.conf and extract is show below from our configuration that was created though our YaST set-up.
The section [global] covers the settings for the servers and then we have sections for shares such as [homes] as you can see from the graphic. This files needs to be edited with root privileges and the smb service restarted on changes. You can gedit or kate as graphical text editors, or if you are familiar with vi the ubiquitous command line editor. To create a new share as we saw before from YaST this can be done in the GUI but it is easier to explain from the smb.conf and not difficult to add shares either in this way. Lets first take a look at an existing share, the directory /home is shared out by default on openSUSE. This is not the users individual home directory but the top level directory that is used to host each individual users' home directory. Think of this as the c:\users directory that you would find on Windows Server 2008 or Windows 7.
Now if you want to create a new share, you can use the YaST tool, however if you edit the /etc/smb.conf you just need to add these lines to share the /tmp directory as an example. [temp] path = /tmp Once added to the file and saved we need to test the configuration for errors with the command testparm. If that is successful then restart the service with the command rcsmb restart . Note: On SUSE we can control services with short-cuts called symlinks. These all begin with rc and are included your path statement so tab-completion can be used. This makes the process of service management more simple on SUSE. If you are using or used to other distributions you can still start the services from the /etc/init.d directory or use the command service .
The SAMBA service is now ready but you may recall we have just one SAMBA user, root. If we need to enable others we must do so either though YaST or as root from the command line. The command line, I feel, is the easiest was as the GUI is a little complex for this particular task. To enable an account for SAMBA we can use the command line tool smbpasswd.
|