[Linux,Xubuntu]Samba Server

๐Ÿ‘‰๐Ÿป Samba Server๋Š” ๋‹ค๋ฅธ ์šด์˜์ฒด์ œ๋‚˜ ๊ธฐ๊ธฐ์—์„œ ๋„คํŠธ์›Œํฌ๋กœ ์„œ๋ฒ„์— ์ ‘์†ํ•  ์ˆ˜ ์žˆ๋„๋ก ๋„์™€์ค๋‹ˆ๋‹ค.(์œˆ๋„์šฐ ํŒŒ์ผ๊ณต์œ )
Samba Server allows you to connect to a server over a network from other operating systems or devices (Windows file sharing).

๐Ÿ‘‰๐Ÿป ์„ค์น˜ / Install

sudo apt install samba

๐Ÿ‘‰๐Ÿป ์„ค์ • ํŒŒ์ผ ์ˆ˜์ • / Edit configuration file

โœ”๏ธ ๋‹ค์Œ ์„ค์ • ํŒŒ์ผ์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค. / Modify the following settings file

sudo nano /etc/samba/smb.conf

โœ”๏ธ ํŒŒ์ผ ๋์— ๋‹ค์Œ ๋‚ด์šฉ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. / Add the following to the end of the file

[share]
path = /home/์‚ฌ์šฉ์ž/share
browsable = yes
writable = yes
valid users = ์‚ฌ์šฉ์ž๋ช… / Username   
create mask = 0664
directory mask = 0775

โœ”๏ธ ๊ฒŒ์ŠคํŠธ ์„ค์ • / Guest settings

[share]
path = /home/์‚ฌ์šฉ์ž/share
browsable = yes
writable = yes
guest ok = yes
read only = no

โœ”๏ธ samba ์„œ๋ฒ„ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ถ”๊ฐ€ / Add samba server password

โญ๏ธ sudo smbpasswd -a ์‚ฌ์šฉ์ž๋ช… ๋ช…๋ น์œผ๋กœ Samba ์ „์šฉ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด, ๋‹ค๋ฅธ ์šด์˜์ฒด์ œ(๋งฅ, ์œˆ๋„์šฐ, ์•ˆ๋“œ๋กœ์ด๋“œ ๋“ฑ)์—์„œ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ธ์ฆ์ด ํ•„์š”ํ•œ ๊ณต์œ  ํด๋”์— ์ ‘์†ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
If you do not set a Samba-specific password using the sudo smbpasswd -a username command, you will not be able to access shared folders that require password authentication from other operating systems (Mac, Windows, Android, etc.).

sudo smbpasswd -a ์‚ฌ์šฉ์ž๋ช…/Username   # Samba ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ • / Setting the Samba password

โœ”๏ธ samba ์„œ๋ฒ„ ์žฌ์‹œ์ž‘ / Restart the Samba server

sudo systemctl restart smbd

๋˜๋Š” / or

sudy service samba restart

๐Ÿ‘‰๐Ÿป UFW ๋ฐฉํ™”๋ฒฝ ์˜คํ”ˆ / UFW firewall open

sudo ufw allow samba
sudo ufw reload

๐Ÿ‘‰๐Ÿป ๋งฅ์—์„œ ์ ‘์† / Connect from Mac

โœ”๏ธ ์ƒ๋‹จ ๋ฉ”๋‰ด์—์„œ ์„œ๋ฒ„์—ฐ๊ฒฐ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. (๋‹จ์ถ•ํ‚ค: Command + K)
Select Server Connection from the top menu (shortcut: Command + K)

โœ”๏ธ ์„œ๋ฒ„ ์ฃผ์†Œ ์ž…๋ ฅ์ฐฝ์ด ๋œจ๋ฉด ๋‹ค์Œ ์ฒ˜๋Ÿผ ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
When the server address input window appears, enter the address as follows.

— smb://Xubuntu-PC์˜-IP-์ฃผ์†Œ ์˜ˆ: smb://192.168.1.100

โœ”๏ธ ์—ฐ๊ฒฐ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ์ธ์ฆ์ฐฝ์ด ๋‚˜ํƒ€๋‚ฉ์ด๋‹ค.
When you click the connect button, an authentication window will appear.

โœ”๏ธ ๋ฆฌ๋ˆ…์Šค ์‚ฌ์šฉ์ž์ด๋ฆ„๊ณผ sudo smbpasswd -a๋กœ ์„ค์ •ํ•œ samba์ „์šฉ ํŒจ์Šค์›Œ๋“œ๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
Enter your Linux username and the Samba-specific password you set with sudo smbpasswd -a.

โœ”๏ธ ์ •์ƒ์ ์œผ๋กœ ์—ฐ๊ฒฐ๋˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ™”๋ฉด์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
If connected successfully, you will see the following screen.

Screenshot
Screenshot

Leave a Reply