반응형

리눅스(우분투)에서 삼바를 설치하고 사용해 보자.

 

2020.01.03 - [Linux] - How to install and use Samba in Fedora Linux 페도라 리눅스에서 Samba 사용하기

 

samba를 설치한다.

 

smb.conf 파일을 수정한다.

/etc/samba/smb.conf 파일 끝에 아래 내용을 추가한다.

[share]
path = /share
public = yes
writable = yes

 

smb.conf 내용대로 공유할 디렉토리를 만든다. (path = /share)

 

smb.conf 설정에 문제가 없는지 확인한다.

 

 

samba 접속을 위해 IP 주소를 확인한다. (192.168.171.200)

 

다른 컴퓨터에서 접속이 가능하다.

\\192.168.171.200
\\192.168.171.200\share

 

반응형
Posted by J-sean
:
반응형

Raspbian을 설치하고 업데이트, 한글, 고정 IP, VNC, Samba 설정등을 진행 한다.

 

기본 사용자: pi

기본 암호: raspberry

 

sudo apt-get update

 

sudo apt-get upgrade

 

Preferences - Add/Remove Software 클릭

 

Nanum Korean fonts 설치

 

Nabi 설치

 

im-config 설치

 

 

 

Preferences - Input Method 클릭

 

OK 클릭

 

Yes 클릭

 

hangul 선택

 

OK를 클릭하고 재부팅 한다. 재부팅해도 한글 입력이 되지는 않는다.

 

Raspberry Pi Configuration - Localisation - Locale에서 언어를 한국어로 바꾸고 다시 재부팅 한다.

 

 

 

'한/영'키나 'Shift + Space'키를 누르면 한글이 입력 된다.

 

Timezone을 Asia-Seoul로 바꿔준다.

 

netstat -nr 명령어로 Gateway주소를 확인한다.

 

/etc/dhcpcd.conf 파일 아래에 고정할 ip주소를 지정한다.

 

interface eth0

static ip_address=고정할 ip주소/24

static routers=Gateway 주소

static domain_name_servers=Gateway 주소

 

(무선 랜카드를 사용 한다면 interface를 eth0이 아닌 wlan0로 바꿔 준다)

 

재부팅하고 확인해 보면 지정한 ip주소로 고정 된다.

 

Raspbian은 기본적으로 VNC Server가 설치 되어 있지만 Raspberry Pi Desktop은 VNC Server가 설치되어 있지 않다.

필요한 경우 X11VNC Server를 설치 한다.

 

 

 

X11VNC Server를 실행 한다.

 

기본 설정으로 두고 OK를 클릭 한다.

 

Accept Connections를 체크한다.

암호가 필요 없다면 그대로 두고 OK를 클릭 한다.

 

RealVNC Viewer등으로 원격 접속하여 사용 할 수 있다.

 

VNC Server를 가끔 쓴다면 위와 같이 매번 사용할 때만 실행하면 되지만 VNC Server가 항상 실행되어야 한다면 rc.local에 등록하여 부팅시 자동으로 실행 되도록 한다. /etc/rc.local 파일을 열어 준다.

 

exit 0 명령어 위에 X11VNC Server를 실행하는 명령어를 넣고 저장 한다.

 

su pi -c 'x11vnc -loop -forever'

 

아래 링크를 참고한다.

2022.05.29 - [Linux] - Linux(Ubuntu, Raspberry Pi OS) 자동실행(rc.local)

 

이제 부팅시 자동으로 X11VNC Server가 실행 된다.

 

 

 

Samba를 설치 한다.

 

/etc/samba/smb.conf 파일끝에 아래 내용을 추가 한다.

 

[share]

path = /share

public = yes

writable = yes

 

testparm 명령을 실행 해서 smb.conf 파일에 문제가 없는지 확인 한다.

 

path에 지정한 /share 디렉토리를 만들고 읽기, 쓰기, 실행이 가능하도록 rwx 권한을 준다.

 

smbd은 자동으로 실행 및 등록 된다.

 

이제 /share 디렉토리는 다른 컴퓨터에서 접근 가능 하다.

 

공유기에서 Port forwarding 설정이 필요 하다면 netstat 명령어로 필요한 port를 확인 한다.

 

컴퓨터를 켜거나 재부팅하면 항상 위와 같은 GRUB 화면이 나온다. 여기서 몇 초(5초) 기다리거나 엔터키를 한 번 눌러야 부팅이 시작된다. 바로 부팅 되도록 해보자.

 

/etc/default/grub 파일을 열자.

 

GRUB_TIMEOUT=5로 되어 있다. 그래서 5초를 기다려야 했던 것이다.

 

기다리지 않고 바로 부팅되도록 0으로 바꾸고 저장한다.

 

sudo update-grub 명령으로 업데이트 한다. 이제 기다릴 필요 없이 바로 부팅된다.

 

반응형
Posted by J-sean
:
반응형

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.


This post describes how to create a public share on Samba in Fedora Linux.


Samba를 이용해 윈도우에서도 접속 가능한 리눅스 공유 폴더를 간단히 만들 수 있다. 사용자 이름이나 암호 없이 접속 가능한 간단한 공유 폴더를 만들어 보자.


Download and install Samba package.


Edit '/etc/samba/smb.conf'


Add the following in [global].

netbios name = sean

map to guest = Bad User


Make [share] at the end and add the following in it.

path = /share

public = yes

writable = yes


Run 'testparm' and check 'smb.conf'.


Move to the root directory and make a directory you want to share.

The name of the sharing directory has to be the same as the name you assigned to 'path' in 'smb.conf' [share].


※ 'share' has read and execute permissions only for 'other'. So if you access it as an 'other', you can't write to it unless you give write permission to 'other'. (chmod 777 share)



Add Samba service to the firewall and reload it.


Start and enable Samba. To start services automatically at boot, you must enable them.


Run 'File Explorer' in Windows and access to the sharing directory in Linux by its IP address.


You can also access the directory by the name you assigned to 'netbios name' in 'smb.conf' [global]


반응형
Posted by J-sean
: