블로그 이미지
은총애비!!

카테고리

분류 전체보기 (2538)
Linux (35)
Error 해결 방법 (5)
소소한 일상 (1631)
사진실 (0)
책책책, 책을 읽읍시다!! (21)
기타(JSP & DB & 등등) (4)
미국 주식 관련 (543)
아침형 인간 프로젝트 (292)
Total
Today
Yesterday
반응형

[MicroServer G7 N54L] samba 설치 및 설정

 

윈도우에서도 쉽게 접근 할 수 있는 방법 입니다.

우선 쉽게 소스 설치가 아닌 패키지 설치 및 설정 하는 방법을 설명 하겠습니다.

 

 

- 삼바 설치

[root@localhost samba]# yum -y install samba   => 삼바를 설치 합니다.

 

 

- 삼바 설정

[root@localhost samba]# vi /etc/samba/smb.conf

윈도우에서 접속하면 리눅스 기본 계정 홈 디렉토리가 보입니다.

리눅스 계정 전 사용자가 사용할 수 있는 공용 폴더를 만드는 방법 입니다.

기본 설정은 그냥 그대로 두고

제일 마지막에 public에서

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;       [public]
;       comment = Public Stuff
;       path = /home/samba
;       public = yes
;       writable = yes
;       printable = no
;       write list = +staff

 

       [public]
       comment = Public Stuff
       path = /home/samba
       public = yes
       writable = yes
       printable = no
       write list = +staff

앞에 ;를 제거합니다.

 

 

- 사용자 등록

[root@localhost samba]# smbpasswd -a [사용자 계정]

[root@localhost samba]# smbpasswd sambauser1   => 삼바 접속 비밀번호 설정을 합니다.
New SMB password:
Retype new SMB password:
[root@localhost samba]#


 

- 방화벽 설정

[root@localhost samba]# system-config-firewall   => 방화벽 설정으로 들어갑니다.

삼바 관련 체크 하고 적용 하고 나갑니다.

또는

[root@localhost samba]# vi /etc/sysconfig/iptables 삼바 관련된 tcp/udp를 추가 합니다.

그리고 아래와 같이 방화벽을 재시작 합니다.

[root@localhost samba]# service iptables restart    => 방화벽을 재시작 합니다.

 

 

- 윈도우에서 삼바 접근

익스플로러나 탐색기에서 \\리눅스 ip 또는 도메인명으로 접속

id/pass를 넣으면 기본 계정 폴더와 public 폴더가 보일 것입니다.

 

반응형
Posted by 은총애비!!
, |
반응형

[MicroServer G7 N54L] Linux 시간 설정

 

리눅스를 설치 하고 나면 시간이 잘 안 맞습니다.

타임서버의 시간으로 동기화를 하는 겁니다.

 

[root@localhost /]# rdate [옵션] [타임서버]

-p : 타임서버의 시간 출력

-s : 타임서버의 시간으로 동기화

time.bora.net : 타임서버 주소

 

[root@localhost /]# rdate -p time.bora.net    => 타임 서버의 현 시간을 보여 줍니다.
rdate: [time.bora.net]  Wed Oct 15 23:53:15 2014

[root@localhost /]#

 

[root@localhost /]# rdate -s time.bora.net     => 타입서버 시간으로 동기화 합니다.
[root@localhost /]# date
2014. 10. 15. (수) 23:54:01 KST
[root@localhost /]#

 

반응형
Posted by 은총애비!!
, |
반응형

[MicroServer G7 N54L] VMWARE에서 HDD 추가 / 마운트 까지...

 

우선 Power Off 합니다. 그리고

상단 메뉴중 VM -> Setting (CTRL + D) -> ADD -> Hard Disk -> Next -> Next -> Next -> 용량 선택 -> Finish

이렇게 하면 HDD는 추가 한겁니다.

 

다시 Power On.

 

그리고 ssh로 접속해서 fdisk -l 을 하면 아래와 같이 나옵니다.

fdisk -l 현재 장착되어 있는 disk를 보여주는 명령어 입니다.

 

[root@localhost qual]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000f560

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1045     8387584   83  Linux
/dev/sda2            1045        2350    10485760   83  Linux
/dev/sda3            2350        2611     2097152   82  Linux swap / Solaris

Disk /dev/sdb: 106 MB, 106954752 bytes
64 heads, 32 sectors/track, 102 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
[root@localhost qual]#

[root@localhost qual]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x996eed0e.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help):

 

n => 새로운 파티션을 만듭니다.

- p => 기본 파티션 생성

- e => 확장 파티션 생성

w => 파티션 테이블 설정 저장

 

[root@localhost qual]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd4f54031.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n => 새로운 파티션 생성
Command action
   e   extended
   p   primary partition (1-4)
p => 기본 파티션 생성
Partition number (1-4): 1 => 파티션 번호
First cylinder (1-102, default 1):
Using default value 1  => 하드디스크 용량 시작점.
Last cylinder, +cylinders or +size{K,M,G} (1-102, default 102):
Using default value 102  => 하드디스크 용량 끝. (100메가 하드 디스크 추가)

Command (m for help): w => 파티션 테이블 설정 저장(위에 설정한것 저장)
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost qual]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000f560

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1045     8387584   83  Linux
/dev/sda2            1045        2350    10485760   83  Linux
/dev/sda3            2350        2611     2097152   82  Linux swap / Solaris

Disk /dev/sdb: 106 MB, 106954752 bytes
64 heads, 32 sectors/track, 102 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd4f54031

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         102      104432   83  Linux      => 추가로 /dev/sdb1로 생성됨.
[root@localhost qual]#

 

마지막에 w를 하고 파티션 설정을 꼭 저장해야 됩니다.

이제 디스크를 추가 했으니 사용하기전에 포멧을 해야합니다.

 

파일 시스템 포멧 명령어

mkfs -t [파일 시스템] [파티션 경로]

ex) 파일 시스템(ext3/ext4 등등등)

[root@localhost /]# mkfs -t ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
26208 inodes, 104432 blocks
5221 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
2016 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost /]#

 

파일 시스템 확인 명령어

file -s [파티션 경로]

[root@localhost /]# file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)
[root@localhost /]#

 

이제 파티션을 추가하고 포멧도 했습니다.

추가한 하드를 쓰려면 이제 마운트(MOUNT) 하면 됩니다.

 

마운트를 하기위해 디렉토리를 만듭니다.

[root@localhost /]# mkdir Backup
[root@localhost /]# ls
Backup  bin  boot  cgroup  dev  etc  home  lib  lost+found  media  misc  mnt  net  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var
[root@localhost /]#

 

마운트 명령어

mount [파티션 경로] [마운트 할 경로]

[root@localhost /]# mount -t ext4 /dev/sdb1 /Backup

 

마운트 정보 확인

df -h

[root@localhost /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.8G  3.7G  3.7G  51% /
tmpfs                 504M   72K  504M   1% /dev/shm
/dev/sda2             9.8G   24M  9.2G   1% /home
[root@localhost /]# mount /dev/sdb1 /Backup
[root@localhost /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.8G  3.7G  3.7G  51% /
tmpfs                 504M   72K  504M   1% /dev/shm
/dev/sda2             9.8G   24M  9.2G   1% /home
/dev/sdb1              95M  1.6M   87M   2% /Backup    => mount로 새롭게 추가!!
[root@localhost /]#

이렇게 하면 끝!!!

 

하지만!! 이건 일시적인것 뿐...

재부팅을 하면 마운트를 다시 해야 합니다.

재시작을 해도 마운트가 풀리지 않도록 fstab에 등록하면 됩니다.

vi /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sat Oct  4 20:51:39 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=cba4e03b-05d6-4b79-ace8-8955caf5f295 /                       ext4    defaults        1 1
UUID=d316c840-a6c0-443f-b5cd-64a1c0eded2d /home                   ext4    defaults        1 2
UUID=25c07c8b-002b-43a8-ab41-a7790ec6307d swap                    swap    defaults        0 0
/dev/sdb1               /Backup                 ext4    defaults        0 0   => 추가

tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

반응형
Posted by 은총애비!!
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함