Samba authentication through PAM with MySQL
2009-05-13 02:30:16来源:未知 阅读 ()
Ed. note: Randall actually wrote this article back in November, but I've only just put
it on the site today.
Note: this assumes you have
Samba
,
mySQL
and
pam_mysql
already installed and running on
FreeBSD
4.0 or
greater The following describes how to setup Samba, PAM, and mySQL such that Samba users
are authenticated through MySQL using PAM.
You can obtain pam_mysql from the link above, or you can install it from the ports: /usr/ports/security/pam-mysql.
by:
randall s. ehren
Step 1: Configure MySQL
The following inserts the root user and a sample user both with a password of
"secretpw". The password encryption is done via MySQL's ENCRYPT function. insert
the following SQL:
CREATE DATABASE samba_auth;
CREATE TABLE users (
uid int(6) NOT NULL auto_increment,
gid int(6) DEFAULT '0' NOT NULL,
last_name varchar(80) NOT NULL,
first_name varchar(80) NOT NULL,
login varchar(16) NOT NULL,
date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
password varchar(16) NOT NULL,
PRIMARY KEY (uid),
KEY uid (uid),
UNIQUE uid_2 (uid)
);
INSERT INTO users VALUES (
'0', '0', 'account', 'root', 'root',
'NOW()', ENCRYPT('secretpw')
);
INSERT INTO users VALUES (
'1', '1', 'account', 'sample', 'sample',
'NOW()', ENCRYPT('secretpw')
);
Step 2: Configure PAM
pam_mysql has the following configuration options available:(options in parentheses
are defaults)
- user(nobody) -- The user with access to the open the connection to mysql and has
permission to read the table with the passwords.
- passwd("") -- Password for the same.
- host(localhost) -- Machine that is running the sql server
- db(mysql) -- database that contents the table with the user/password combos
- table(user) -- table that you want to use for the user/password checking
- usercolumn(User) -- column that has the username field
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
上一篇:qmail安装脚本
- Freebsd oracle 10g 2009-05-13
- KDE/FreeBSD 测试 QT-4.5.1. 2009-05-13
- OpenBSD 4.5下安装Gnome 2.24成功! 2009-05-13
- OpenBSD 4.5 2009-05-13
- DragonFly BSD 2.2.1发布 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash