DebianLinux install and configure the smb service

Source: Internet
Author: User
Server configuration process: 1. apt-getinstallsamba2. modify/etc/samba/smb. conf file 3. add user and set samba access password smbpasswd-ausername4. restart the samba service:/etc/init. d/smbrestart1.apt-getinstallsamba (installation) debconf

Server configuration process:
1. apt-get install samba
2. modify the/etc/samba/smb. conf file.
3. add a user and set the samba access password
Smbpasswd-a username
4. restart the samba service:
/Etc/init. d/smb restart

1. apt-get install samba (installation)
Debconf (Select)
Workgroup)
....
2. create a user (note: This user is an existing user in the system. debian is used as an example)
Create a passwd file: touch/etc/samba/smbpasswd
Smbpasswd-a reny
Password:
3. edit the configuration file:
Vi/etc/samba/smb. conf
Add our configuration information:
[Home]
Comment = laowang's data
Path =/home
Valid users = reny
Public = no
Writable = yes
Printable = no
Create mask = 0777
4. restart the samba service:
/Etc/init. d/samba restart
Supplement: # chmod 775/home (windows can be written)
Turn: http://hi.baidu.com/lovely_sunday/blog/item/5d79cc33081c24fc1a4cff13.html
1. install samba # apt-get install samba

Note: the configuration file of the Samba server is named smb. conf, which is located in the/etc/samba/directory. There is also an smb in the/usr/share/samba/directory. conf file backup, if you set/etc/samba/smb when configuring the server. the conf file can be used to restore to the initial state. The startup script is located in/etc/init. d/directory, called samba. if smb is modified. conf configuration file, available #/etc/init. d/samba restart command to restart the Samba server. In the/etc/default/samba file, you can set the startup mode of the samba server, daemons or inetd. the default setting is daemons:

For example, to share files in windows and debian, create a shared folder on debian, and users in windows can modify the shared folder.

2. create a user

# Smbpasswd-a linuxsir (create a samba password for the user)

Prompt to enter password ....

3. configure samba and open the configuration file/etc/samba/smb. conf,

Replace:

[Global] ---> global configuration, required
Workgroup = LinuxSir ---> workgroup displayed in Windows
Netbios name = LinuxSir05 ---> Computer name displayed in Windows
Server string = Linux Samba Server TestServer ---> Samba server description
Security = share ---> authentication and logon methods,
[Linuxsir]
Path =/opt/linuxsir ---> location of the shared directory
Writeable = yes ---> can be written to the shared directory.
Browseable = yes ---> browsed
Guest OK = yes ---> anonymous users log on as guest

4. create a directory and authorize it;

5. start samba #/etc/init. d/samba start

6. check the current configuration # testparm

7. assume that the IP address in windows is 192.168.0.7 and the IP address in debian is 192.168.0.8.

Enter smbclient-L 192.168.0.7 in debian to access windows

In windows, enter \ 192.168.0.8 to access debian. the folder shared by the debian host is displayed in the network neighbor.

8.

Disable the smbcontrol program available on the server. The command format is as follows:

Debian ~ : # Smbcontrol smbd shutdown

Appendix. set directory sharing and permissions

========= Share Definitions ==========================

[Share] set the share name

Comment = description of the Directory

Path =/data/temp: absolute location of the directory to be shared

The following table lists the selectable directories.

Browseable = no indicates whether the directory is visible. the default value is visible.

Whether the writable = yes directory is writable

Read only = no whether the directory is read-only

Whether the guest OK = yes can be accessed, which is the same as "public = yes ".

Write list = user, @ group: writable list. @ indicates a group.

Valid users =... list of users allowed to access

Read list =... a list of readable users

Invalid users =... list of users prohibited from access

Admin users =... list of users with administrative permissions

Create mask = 0755 the user's permission to create an archive. the default value is 0744.

# Mkdir-p/opt/linuxsir
# Id nobody
Uid = 65534 (nobody) gid = 65534 (nogroup) groups = 65534 (nogroup)
[Root @ localhost ~] # Chown-R nobody: nogroup/opt/linuxsir

Use the samba command:

1. View shared directories

# Smbclient // debian

2. access the shared directory

# Smbclient \\\\ debian \ share-U Sunday

Enter "?" at the prompt Command to find the commands you can use.

Related Article

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.