Samba Cheat Sheet Command Page

Mount Sharing Folder in a other Server, Workstation running Linux Samba Shared Directory or Folder

mount -t cifs //xxx.xxx.xxx.xxx/shared_name /mnt/mount_point_name/ -o username=samba_username_for_access

Example :

user@hostname:~# mount -t cifs //10.0.0.17/shared /mnt/test/ -o username=mike
Password for mike@//10.0.0.17/shared ****************
user@hostname:~#

How to Share Folder in Linux using samba

This is an article for showing on how to share folder in Linux using an utility called samba. Precisely before sharing a specific folder in Linux, to be able to make a certain person or only a specific user that can access that specific folder shared, first of all create a user for accessing it. The article for creating user can be found in the following article titled ‘Add Samba User in Linux with smbpasswd’ in this link or another article titled ‘Create User for specific purpose like Samba Sharing’ in this link or even in this link which is actually an article titled ‘Reset Samba User Password via Command Line’ to reset password for an existing samba user.

So, after the user has already been created the next step is to make sure that the sharing folder definition has already been defined. Below are steps taken to provide the sharing folder via samba :

Continue reading “How to Share Folder in Linux using samba”

Mounting Samba and Copy File

This article happen to be another series and the continuity of the previous article discussed about samba service usage. One of the article titled ‘Samba Access Error session setup failed NT_STATUS_LOGON_FAILURE’ which can be found in this link, providing an information on accessing samba sharing definition by resolving the error specified. Another article which is focusing on how to copy file from across file and folder sharing definition is described in article titled ‘Copy file from Linux to Windows file and folder sharing’ and it can be visited in this link.

Basically, there is a clear and solid difference on the samba configuration provided in the article presented with the title of ‘Samba Access Error session setup failed NT_STATUS_LOGON_FAILURE’ recorded in this link with the one presented in this article which is normally located in /etc/samba/smb.conf. That line is the following :

Continue reading “Mounting Samba and Copy File”

Reset Samba User Password via Command Line

This is an article describe on how to reset a user defined in samba folder and file sharing service. As we already knew that samba folder and file sharing service has its own sharing definition’s access.

To create a user for samba access, read the following article titled ‘Add Samba User in Linux with smbpasswd‘. After successfully created user with the specified command described in that article, in case there is something happened such as password for samba user is forgotten or any other conditions met to force or reset the password below is how to accomplish the purpose, just execute the following command :

Continue reading “Reset Samba User Password via Command Line”

Samba Access Error session setup failed NT_STATUS_LOGON_FAILURE

Using samba to access folders or files which has been shared depends on the samba file configuration that has already been configured. There are lots of parameters used in different values and purpose. Wrong configuration of samba service will affect the service itself so that it cannot serve its purpose to share files or folders correctly.

An error accessing samba shared which has already been defined is samba file configuration located in /etc/samba/smb.conf is shown below :

root@hostname:/var/log# smbclient -Umyguest -L //localhost/share
WARNING: The "syslog" option is deprecated
Enter myguest's password:
session setup failed: NT_STATUS_LOGON_FAILURE
root@hostname:/var/log# smbclient -Umyguest -L //localhost/share
WARNING: The "syslog" option is deprecated
Enter myguest's password:
session setup failed: NT_STATUS_LOGON_FAILURE
root@hostname:/var/log# smbclient -Umyuser -L //localhost/share
WARNING: The "syslog" option is deprecated
Enter myuser's password:
session setup failed: NT_STATUS_LOGON_FAILURE
root@hostname:/var/log# smbclient -Umyuser -L //localhost/share
WARNING: The "syslog" option is deprecated
Enter myuser's password:
root@hostname:/var/log#

This is the samba configuration file which is already defined :

Continue reading “Samba Access Error session setup failed NT_STATUS_LOGON_FAILURE”

Copy file from Linux to Windows file and folder sharing

In order to be able to copy file from Linux operating system to another host, server or workstation which is installed with a Windows operating system where the file exists as a file and folder sharing, below are the steps which is needed to be done :

1. By using samba-client package which is assumed already installed in the linux operating system distribution, the process of copying files can be executed. First of all please check whether the samba-client package has already been installed by reading this article on checking installed package in Ubuntu Linux or suit the way with the environment of the operating system in the server.

2. If the  samba-client package hasn’t been installed yet, read this article to know how to install the package.

3. After successfully installed samba-client package, try to type it in the bash prompt just to make sure that the command can actually be called. The utility is ‘smbclient’ which is a command part of the samba-client package. Below is how to use the command :

Continue reading “Copy file from Linux to Windows file and folder sharing”

Samba Linux Test Configuration File Command

This is another article discuss on testing samba configuration file. To be able to change the original samba file configuration, it is a wise decision if the step executed for the first time is backup the original file by duplicating it into another file.

After duplicating the file into another file name, the original file of samba configuration can be edited. Below is the process of executing it :

Continue reading “Samba Linux Test Configuration File Command”