공유서버
nfs :
samba
어떤기종으로 공유를 하느냐에 따라...
nfs 공유 서비스
자원을 공유로 시작해서 서비스(port)를 받아감
장점:자원공유
네트워크연결
자원,인증,디렉토리권한
--서버--
[root@angelserv ~]# rpm -qa nfs-utils
nfs-utils-1.0.6-84.EL4
rpm -a^Hqa pr[root@angelserv ~]#
[root@angelserv ~]# rpm -qa nfs-utils
nfs-utils-1.0.6-84.EL4
[root@angelserv ~]# rpm -qa portmap
portmap-4.0-63
[root@angelserv ~]# chkconfig nfs on
[root@angelserv ~]# chkconfig --list nfs
nfs 0:해제 1:해제 2:활성 3:활성 4:활성 5:활성 6:해제
[root@angelserv ~]# chkconfig --list portmap
portmap 0:해제 1:해제 2:해제 3:활성 4:활성 5:활성 6:해제
--- portmap Service : 활성화 여부 확인
[root@angelserv ~]# vi /etc/exports
1 /share 192.168.1.134$
[root@angelserv ~]# service nfs restart
NFS mountd를 종료 중입니다: [ 확인 ]
NFS 데몬을 종료 중입니다: [ 확인 ]
NFS quota를 종료 중입니다: [ 확인 ]
NFS 서비스를 종료 중입니다: [ 확인 ]
NFS 서비스를 시작하고 있습니다: [ 확인 ]
NFS 쿼터를 시작하고 있습니다: [ 확인 ]
NFS 데몬을 시작함: [ 확인 ]
NFS mountd를 시작하고 있습니다: [ 확인 ]
1.ide
scsi(sda)
2. fdisk 명령어 찾아보기
3.fdisk 를 할때 파티션을 나누는 두가지 방식
기본방식P 3개
확장방식E
4.mkfs
HDD - ide - hd abc...
scsi - 어떤것으로 시작하느냐에 따라서 달라짐
fdisk
4개
boot sawp home 3개는 기본
확장
---------fdisk
/share1 sdb1 오른쪽 (rw)
/share2 hda1 모두접근가능 (ro)
/share3 - > sdb1 : 192.168.1.204(root)
(참고.
http://www.cyworld.com/xjbin/2850828 )
[root@angelserv ~]# fdisk -l
Disk /dev/hda: 8589 MB, 8589934592 bytes
15 heads, 63 sectors/track, 17753 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Disk /dev/hda doesn't contain a valid partition table
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 144 1052257+ 82 Linux swap
/dev/sda3 145 275 1052257+ 83 Linux
/dev/sda4 276 1044 6176992+ 5 Extended
/dev/sda5 276 1044 6176961 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
[root@angelserv ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):
Using default value 1044
Command (m for help): p
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1044 8385898+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@angelserv ~]# fdisk -l
Disk /dev/hda: 8589 MB, 8589934592 bytes
15 heads, 63 sectors/track, 17753 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Disk /dev/hda doesn't contain a valid partition table
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 144 1052257+ 82 Linux swap
/dev/sda3 145 275 1052257+ 83 Linux
/dev/sda4 276 1044 6176992+ 5 Extended
/dev/sda5 276 1044 6176961 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1044 8385898+ 83 Linux
[root@angelserv ~]# fdisk /dev/hda
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 17753.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-17753, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-17753, default 17753):
Using default value 17753
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@angelserv ~]# mkfs.ext3 /dev/hda1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2097065 blocks
104853 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@angelserv ~]# mkfs.ext3 /dev/sda1
mke2fs 1.35 (28-Feb-2004)
/dev/sda1 is mounted; will not make a filesystem here!
[root@angelserv ~]# fdisk -l
Disk /dev/hda: 8589 MB, 8589934592 bytes
15 heads, 63 sectors/track, 17753 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 17753 8388261 83 Linux
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 144 1052257+ 82 Linux swap
/dev/sda3 145 275 1052257+ 83 Linux
/dev/sda4 276 1044 6176992+ 5 Extended
/dev/sda5 276 1044 6176961 83 Linux
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1044 8385898+ 83 Linux
[root@angelserv ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@angelserv ~]# mount /dev/sdb1 /share1
[root@angelserv ~]# mount /dev/hda1 /share2
[root@angelserv ~]# mount /dev/sdb1 /share3
[root@angelserv ~]# exportfs -ar
exportfs: No options for /share 192.168.1.134: suggest 192.168.1.134(sync) to avoid warning
exportfs: No options for /share1 192.168.1.134: suggest 192.168.1.134(sync) to avoid warning
exportfs: /etc/exports [3]: No 'sync' or 'async' option specified for export "192.168.1.131:/share".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: /etc/exports [4]: No 'sync' or 'async' option specified for export "192.168.1.153:/share1".
Assuming default behaviour ('sync').
NOTE: this default has changed from previous versions
exportfs: No options for /share2 *: suggest *(sync) to avoid warning
오후------------------------------------------------------------------------------------
SAMBA Service
[root@angelserv ~]# rpm -qa | grep smb
gnome-vfs2-smb-2.8.2-8.6.EL4
pam_smb-1.1.7-5
You have new mail in /var/spool/mail/root
[root@angelserv ~]# vi /etc/samba/smbusers
1 # Unix_name = SMB_name1 SMB_name2 ...$
2 root = administrator admin$
3 nobody = guest pcguest smbguest$
[ a ] all
\\192.168.1.133\
[ b ] 지정
\\192.168.1.133\a
[root@angelserv home]# vi /etc/samba/smb.conf
57 [global]$
58 ^I$
59 # ----------------------- Netwrok Related Options -------------------------$
60 #$
61 # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH$
62 #$
63 # server string is the equivalent of the NT Description field$
64 #$
65 # netbios name can be used to specify a server name not tied to the hostname$
66 #$
67 # Interfaces lets you configure Samba to use multiple interfaces$
68 # If you have multiple network interfaces then you can list the ones$
69 # you want to listen on (never omit localhost)$
70 #$
71 # Hosts Allow/Hosts Deny lets you restrict who can connect, and you can$
72 # specifiy it as a per share option as well$
73 #$
74 workgroup = WORKGROUP$
75 ^Iserver string = Samba Server Version %v$
76 ^Inetbios name = abc$
77 ^Iinterfaces = 192.168.1.133/24$
78 ^Ihosts allow = 192.168.1.$
79 $
80 ^Ilog file = /var/log/samba/%m.log$
81 ^Imax log size = 50$
82 $
83 ^Isecurity = share$
84 ^Ipassdb backend = smbpasswd$
85 ^Iencrypt passwords = yes$
86 ^Ismb passwd file = /etc/samba/smbpasswd$
258 #============================ Share Definitions ==============================$
259 ^I$
260 idmap uid = 16777216-33554431$
261 idmap gid = 16777216-33554431$
262 template shell = /bin/false$
263 winbind use default domain = no$
264 [homes]$
265 ^Icomment = Home Directories$
266 ^Ibrowseable = no$
267 ^Iwritable = yes$
268 ;^Ivalid users = %S$
269 ;^Ivalid users = MYDOMAIN\%S$
270 ^I$
271 [printers]$
272 ^Icomment = All Printers$
273 ^Ipath = /var/spool/samba$
274 ^Ibrowseable = no$
275 ^Iguest ok = no$
276 ^Iwritable = no$
277 ^Iprintable = yes$
278 #[angelservsmb]$
279 #^Icomment = Linux SAMBA Share Directory$
280 #^Ipath = /smbshare$
281 #^Ibrowseable = yes$
282 #^Ipublic = yes$
283 #^Iread only = yes$
284 [smb05]$
285 ^Icomment = Linux SAMBA Share (Only smb05)$
286 ^Ipath = /home/smb05$
287 ^Ibrowseable = yes$
288 ^Ipublic = no$
289 ^Ivalid users = smb05$
290 ^Iwritable = yes$
291 ^I$
FTP
/etc/rc.d/init.d/vsftpd start 데몬 실행 스크립트
[root@angelserv /]# vi /etc/vsftpd/vsftpd.conf
12 anonymous_enable=NO$ 익명사용자 접속 거부
96 chroot_local_user=YES$ 접속시 /home/student 가 아닌 루트 환경으로 접속