Create a Samba User on Ubuntu

Create a Samba User on Ubuntu
If you are using Samba Server on your network, you will want to create users that have access to use it. There’s a very simple command structure on how to do so.

I’m assuming that you’ve already installed Samba Server at this point.

There are two steps to creating a user. First we’ll run the smbpasswd utility to create a samba password for the user.

sudo smbpasswd -a <username>


Next, we’ll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers

Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = “<samba username>”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

<username> = “<username>”

Now you can create samba shares and give access to the users that you listed here.




sudo: unable to resolve host ubuntu-server

sudo: unable to resolve host ubuntu-server

My /etc/hosts file:       localhost       ubuntu-server

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
FF02::2 ip6-allrouters

/etc/hostname gives:


I think there is some other setting that causes the unable to resole host, but I cannot find these.

Edit the /etc/hosts, you have a typo is not loopback, change it to, save and reboot.

How to configure Samba using a graphical interface in Ubuntu


One of the most asked features for Samba is a graphical user interface to help with configuration and management,  there are now several GUI interfaces to Samba available, one of these tools is samba server configuration tool.

“The Samba Server Configuration Tool is a graphical interface for managing Samba shares, users, and basic server settings. It modifies the configuration files in the /etc/samba/ directory. Any changes to these files not made using the application are preserved.”


In our previous post we showed you how to configure samba via command line, today we will see together how to configure samba using a graphical interface in Ubuntu

Installing Samba:

First thing we need to do is to install samba, go to Software center in Ubuntu and search for samba then install the package. If you want to install it via terminal then copy this command :

sudo apt-get  install  samba samba-common

Installing Samba Server configuration Tool:

Now install the graphical interface System-config samba

sudo apt-get install system-config-samba

Configuration of samba using a graphical interface:

Now we will try for example to share the directory  /home/pirat9/share folder to do that,

First open GUI samba  server configuration tool by going to System–> Administration–>Samba

Add the  folder you want to share and setup the permissions access.

Now  right click on the  folder directory you want to share and open the  share  options

Then select share this folder

If you want to setup folder access permissions, right click on the folder and open properties (See screenshot bellow)

If you want to add a password to the user: open a terminal and type the command  :

sudo  smbpasswd  -a pirat9

and  then type your password.

Now the configuration is done.

Now lets try to check if we can for example connect from a windows machine. To do that

In a windows machine go to start –>Run and type :

 ip  or  hostname

You will be asked to insert the user and password

Check the  share  folder

And is done.

For questions please refer to our Q/A forum at : 

[轉]縮小VMWare Workst…


縮小VMWare Workstation中vmdk檔案的大小

Original url:

隨著使用時間的拉長,vmware 中 vmdk的檔案大小隻會越來越大,

就算在guest os中把檔案刪掉了,host os中的vmdk檔案也不會縮小。

以下方法,可以有效的把vmdk檔縮小到guest os中真正有使用到的檔案大小,

讓你的vmdk檔不再虛胖。以下方法適用guest os為windows系統。

1.先進入guest os中,把不要的檔案刪除。

2.於guest os中執行清理磁碟,把暫存檔清除。

3.於guest os中,下載SDelete程式,並且解壓縮
本站下載  版本:v1.6

4.於guest os中進入console端
開始 -> 執行 -> CMD


sdelete -c -z

———————SDelete 使用說明———————-

SDelete – Secure Delete v1.6
Copyright (C) 1999-2010 Mark Russinovich
Sysinternals –

usage: sdelete [-p passes] [-s] [-q] <file or directory> …
sdelete [-p passes] [-z|-c] [drive letter] …

-a Remove Read-Only attribute
-c Clean free space
-p passes Specifies number of overwrite passes (default is 1)
-q Don’t print errors (Quiet)
-s or -r Recurse subdirectories
-z Zero free space (good for virtual disk optimization)

———————SDelete 使用說明 END—————–

6.SDelete跑完後,把guest os關機。


選擇硬碟 -> 點選Utilites -> 點選Compact