ÔõÑùÉèÖúÍÖÎÀíLinuxÉϵÄÎļþ¹²ÏíЧÀÍ
Linux×÷Ϊһ¿îÓÅÒìµÄЧÀÍÆ÷²Ù×÷ϵͳ£¬¾ßÓкÜÊÇÇ¿Ê¢µÄÎļþ¹²ÏíÄÜÁ¦¡£Í¨¹ýÉèÖúÍÖÎÀíLinuxÉϵÄÎļþ¹²ÏíЧÀÍ£¬¿ÉÒÔÀû±ãµØʵÏÖÎļþ¹²ÏíºÍÐ×÷¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚLinuxϵͳÉϴºÍÖÎÀíÎļþ¹²ÏíЧÀÍ£¬²¢ÌṩÏêϸµÄ´úÂëʾÀý¡£
Ò»¡¢ÉèÖÃÎļþ¹²ÏíЧÀÍ
ÉèÖÃÎļþ¹²ÏíЧÀÍ¿ÉÒÔʹÓÃSambaÈí¼þ°ü£¬SambaÊÇÒ»¸ö¿ªÔ´Ãâ·ÑµÄÈí¼þÌ×¼þ£¬ËüÔÊÐíLinuxϵͳÓëWindows²Ù×÷ϵ×ܹ²ÏíÎļþ¼ÐºÍ´òÓ¡»úµÈ×ÊÔ´¡£ÏÂÃæÎÒÃÇÀ´ÏÈÈÝÏêϸµÄÉèÖð취¡£
1.×°ÖÃSambaÈí¼þ°ü
ʹÓÃÒÔÏÂÏÂÁî×°ÖÃSambaÈí¼þ°ü£º
sudo apt-get update sudo apt-get install samba
µÇ¼ºó¸´ÖÆ
2.½¨Éè¹²ÏíĿ¼
ÔÚÉèÖù²ÏíЧÀÍ֮ǰ£¬ÐèÒªÏȽ¨ÉèÒ»¸ö¹²ÏíĿ¼¡£ÔÚ±¾´ÎÉèÖÃÖУ¬ÎÒÃǽ«½¨ÉèÒ»¸öÃûΪ¡°share¡±µÄ¹²ÏíĿ¼£¬ÏêϸÏÂÁîÈçÏ£º
sudo mkdir /home/share
µÇ¼ºó¸´ÖÆ
3.ÊÚȨ¹²ÏíĿ¼
ÔÚLinuxϵͳÖУ¬¹²ÏíĿ¼µÄÊÚȨÊǺÜÊÇÖ÷ÒªµÄ¡£ÎªÁËʵÏÖ¹²Ïí£¬±ØÐ轫¹²ÏíĿ¼ÊÚȨ¸øÌض¨Óû§»ò×é¡£½«¡°share¡±Ä¿Â¼ÊÚȨ¸øÓû§¡°linuxuser¡±£¬ÏêϸÏÂÁîÈçÏ£º
sudo chown linuxuser /home/share
µÇ¼ºó¸´ÖÆ
4.ÉèÖÃSambaЧÀÍ
ÀÖ³É×°ÖÃSambaºó£¬ÐèÒª±à¼SambaÉèÖÃÎļþ¾ÙÐÐÉèÖ᣿ÉÒÔʹÓÃÒÔÏÂÏÂÁî·¿ªSambaÉèÖÃÎļþ£º
sudo vi /etc/samba/smb.conf
µÇ¼ºó¸´ÖÆ
ÔÚÎļþĩβÌí¼ÓÈçÏÂÉèÖãº
[share] path = /home/share browseable = yes read only = no guest ok = no
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬shareΪ¹²ÏíĿ¼µÄÃû³Æ£¬pathΪ¹²ÏíĿ¼µÄ·¾¶£¬browseable²ÎÊýÉèÖù²ÏíĿ¼ÊÇ·ñ¿É±»ä¯ÀÀ£¬read only²ÎÊýÉèÖÃÊÇ·ñÖ»¶Á£¬guest ok²ÎÊýÉèÖÃÊÇ·ñÔÊÐíÄäÃû»á¼û¡£
5.Æô¶¯SambaЧÀÍ
ÔÚÍê³ÉÒÔÉÏÉèÖú󣬻¹ÐèÒªÆô¶¯SambaЧÀÍ£¬ÏêϸÏÂÁîÈçÏ£º
sudo systemctl restart smbd.service
µÇ¼ºó¸´ÖÆ
ÖÁ´Ë£¬Îļþ¹²ÏíЧÀ͵ÄÉèÖÃÊÂÇéÒÑÍê³É¡£
¶þ¡¢ÖÎÀíÎļþ¹²ÏíЧÀÍ
ÉèÖÃÍê³Éºó£¬ÔõÑùÖÎÀíÎļþ¹²ÏíЧÀÍÄØ£¿ÏÂÃ潫ÏÈÈÝÔõÑùÖÎÀí¹²ÏíЧÀÍ¡£
1.Ìí¼ÓSambaÓû§
ΪÁ˾ÙÐÐÎļþ¹²Ïí£¬ÐèÒªÌí¼ÓSambaÓû§£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÌí¼ÓÓû§£º
sudo smbpasswd -a linuxuser
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬¡°linuxuser¡±ÎªÒªÌí¼ÓµÄÓû§Ãû¡£
2.»á¼û¹²ÏíĿ¼
»á¼û¹²ÏíĿ¼ÐèÒªÔÚWindows²Ù×÷ϵͳÖоÙÐС£ÔÚWindowsÎļþä¯ÀÀÆ÷ÖУ¬ÊäÈëLinuxϵͳIPµØµã¼°¹²ÏíĿ¼Ãû³Æ£¬¼´¿É½øÈë¹²ÏíĿ¼¡£ÈôÊÇ·ºÆð»á¼ûÌáÐÑ¿ò£¬ÐèÒªÊäÈëÌí¼ÓµÄSambaÓû§µÄÓû§ÃûºÍÃÜÂ룬ÊäÈë׼ȷºó¼´¿É»á¼û¹²ÏíĿ¼¡£
3.ÊÚȨ¹²ÏíĿ¼
ÔÚ¹²ÏíĿ¼ÖУ¬ÐèҪΪ²î±ðµÄÓû§ÉèÖÃÏìÓ¦µÄÊÚȨ¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî¾ÙÐÐÊÚȨ£º
sudo chmod -R 775 /home/share
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬775ÊÇÖ¸¿É¶Á¡¢¿Éд¡¢¿ÉÖ´ÐеÄÊÚȨ·½·¨£¬/home/shareÊǹ²ÏíĿ¼µÄ·¾¶¡£
4.ɾ³ýSambaÓû§
ÈôÊÇÐèҪɾ³ýSambaÓû§£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîɾ³ý£º
sudo smbpasswd -x linuxuser
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬¡°linuxuser¡±ÎªÒªÉ¾³ýµÄÓû§Ãû¡£
±¾ÎÄÏÈÈÝÁËÔõÑùÉèÖúÍÖÎÀíLinuxÉϵÄÎļþ¹²ÏíЧÀÍ£¬²¢ÌṩÁËÏêϸµÄ´úÂëʾÀý¡£Îļþ¹²ÏíЧÀÍ¿ÉÒÔÀû±ãµØʵÏÖÎļþ¹²ÏíºÍÐ×÷£¬Ìá¸ßÁËÊÂÇéЧÂÊ£¬Ò²Ìá¸ßÁËÍŶÓÐ×÷µÄЧÂÊ¡£ÔÚÏÖʵӦÓÃÖУ¬¿ÉÒÔƾ֤ÏÖʵÐèÇó¾ÙÐÐÉèÖúÍÖÎÀí¡£
ÒÔÉϾÍÊÇÔõÑùÉèÖúÍÖÎÀíLinuxÉϵÄÎļþ¹²ÏíЧÀ͵ÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡