2012年12月3日月曜日

AIX and CIFS (SMB)

Install

Install bos.cifs_fs.rte from the base AIX media (not included in the base install)
Reboot (!)
Check availability of the SMB special device

$ lsdev -l nsmb0 -F status
Available
Configuration and management


Mount a server share:

# mount -v cifs -n hostname/user/password remote_service /local_mount_point

Make sure you use the service name as defined in smb.conf.

List remote shares anonymously:

$ smbclient [ -s /path/to/smb.conf ] -N -L <servername>
Anonymous login successful
Domain=[AIX] OS=[Unix] Server=[Samba 3.3.4]

Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (samba@myhost)
Anonymous login successful
Domain=[AIX] OS=[Unix] Server=[Samba 3.3.4]

Server Comment
--------- -------

Workgroup Master
--------- -------


Disable anonymous access (smb.conf):

[global]
...
restrict anonymous = 2

The effect:

$ smbclient -N -L localhost
Anonymous login successful
Domain=[AIX] OS=[Unix] Server=[Samba 3.3.4]
tree connect failed: NT_STATUS_ACCESS_DENIED

If 'browseable = no' is set, you cannot list shares anyway...

A sample smb.conf


#======================= Global Settings =====================================
[global]

workgroup = AIX
server string = samba@myhost
security = user
log file = /usr/local/samba/var/log.%m
max log size = 500
passdb backend = tdbsam
local master = yes
domain master = no
preferred master = no
restrict anonymous = 2

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
; hosts allow = 192.168.1. 192.168.2. 127.
; interfaces = 192.168.12.2/24 192.168.13.2/24

#============================ Share Definitions ==============================

;[homes]
; comment = Home Directories
; browseable = no
; writable = yes

[test]
path = /data/shared/smb/test
browseable = no
public = yes
only guest = yes
writable = yes
printable = no
guest ok = yes

0 件のコメント:

コメントを投稿