Quickly configure Samba to map a Linux directory to a Windows drive

Source: Internet
Author: User
Tags ftp client

Original link

Samba Client

Ubuntu

Redhat

Ubuntu GUI Tools

1, list the shared folders provided by an IP address
Smbclient-l 198.168.0.1

2, access to an anonymous directory smbclient//192.168.0.1/directory name in Security=share mode

3, use smbclient like FTP client
Smbclient//192.168.0.1/tmp-u Username%password

4, for example, create a shared folder
Smbclient-c "mkdir share1"//192.168.0.1/tmp-u Username%password
If a user shares//192.168.0.1/tmp in a read-only way, it prompts
nt_status_access_denied Making remote directory \share1
5, in addition to using smbclient, you can also mount and Smbcount remote shared folders
Mount-t smbfs-o username=administrator,password=123456//192.168.0.1/tmp/mnt/tmp # mount-t smbfs-o username= "Admini Strator ", password=" "//192.168.1.100/cp/mnt/ntfs

Prompt error:
Mount: Unknown filesystem type ' Smbfs '

After checking the information, said Smbfs changed to CIFS, so use the following method:

# mount-t Cifs-o username= "Administrator", password= ""//192.168.1.101/cp/mnt/ntfs

Success!!


Smbmount//192.168.0.1/tmp/mnt/tmp-o Username=administrator

To access the directory:

Ubuntu

I. Installation of Samba :

# sudo apt-get Insall Samba

# sudo apt-get install Smbfs

Two. Create a shared directory:

# Mkdir/home/willis/share

# Sodu chmod 777/home/willis/share

Three. Create a Samba configuration file:

1. Save the existing configuration file

# sudo Mv/etc/samba/smb.conf/etc/samba/smb.conf.bak

2. Create a new Samba configuration file

# Sodu Vim/etc/samba/smb.conf

; ############### smb.conf #######################

[Global]

; Create a work group

Workgroup = MyGroup

; Safe Mode, we set the minimum security level

Security = Share

; Whether to allow Guest user access

Guestōk = yes

[Share]

; Shared Folder path

Path =/home/willis/share

; Read permissions

browseable = yes

; Write permissions

writeable = yes

Four. Test file configuration results

# Testparm

Five. Restart Samba services

#/ETC/INIT.D/SMBD Restart

Six. Exit to re-login or restart the machine

Seven. Test login

# smbclient-l//localhost/share

Test from a remote machine:

# smbclient//<samba_server_ip>/share

Success! :-)

Eight. References

To set up Samba shared read-write folders in Ubuntu :
Http://forum.ubuntu.org.cn/about20852.html&highlight=samba
Http://wiki.ubuntu.org.cn/Samba

Original link

 First, the local area network Linux server operation steps:

1. Install Samba (CentOS Linux):

Yum Install samba System-config-samba samba-client Samba-common



2. Create WWW account

/usr/sbin/groupadd www
/usr/sbin/useradd-g www www

Mkdir-p/data0/knose/
chmod 777/data0/knose/

Mkdir-p/data0/htdocs/
Chown-r www:www/data0/htdocs/
chmod 777/data0/htdocs/

cat/etc/passwd | Mksmbpasswd.sh>/etc/samba/smbpasswd



3. Create a Samba configuration file

Mv-f/etc/samba/smb.conf/etc/samba/smb.conf.bak
Vi/etc/samba/smb.conf


Enter the following:

References [Global]
Server string = Samba Server
Security = User
Encrypt passwords = yes
SMB passwd file =/etc/samba/smbpasswd

[Knose]
Workgroup = root
NetBIOS name = root
Path =/data0/knose
browseable = yes
writeable = yes

[web]
Workgroup = www
NetBIOS name = www
Path =/data0/htdocs
browseable = yes
writeable = yes



4. Set up a password for samba users www and root:

Smbpasswd-a www
Smbpasswd-a Root



5. Start Samba:

/sbin/service SMB Start




  Second, the local area network Windows Server operation steps:

1. Access Samba on Windows and enter it in My computer:

\\xxx.xxx.xxx.xxx\



2. Windows disconnects Samba shared connection and enters in start → run → Cmd enter:

NET use */del



3. The Linux directory shared by Samba is mapped to a drive letter from Windows:

  

  

  


  Three, cross-platform C + + code compilation, debugging:

Use the editor under Windows to write, modify the cross-platform C + + code, save, without copying to other places, you can use Windows under the Visual Studio,linux under the g++, GCC, GDB, compile, debug the program.

  

  

Note: It is important to note that the ". bat" Batch script on a drive that is shared by samba causes a blue screen on Windows.

Original: http://www.unixmen.com/how-to-configure-samba-using-a-graphical-interface-in-ubuntu/

Installing Samba:

First thing we need to do are to install Samba, go to Software Center in Ubuntu and search for samba then install the Packa Ge. If you want to the install it via terminal then copy the 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'll try for example to share the Directory/home/pirat9/share folder,

First open GUI Samba server Configuration tool by going to system–> Administration–>samba

ADD the folder 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 the 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 was done.

Now lets try-to-check if we can for example connect from a Windows machine. To does that

In a Windows machine go to Start–>run and type:

IP or hostname

You'll be asked to insert the user and password

Check The Share folder

and is done.

Finish

Quickly configure Samba to map a Linux directory to a Windows drive

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.