LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-31-2012, 07:30 PM   #1
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Rep: Reputation: 32
login to linux with mysql username and password


How do i make a Linux operating system (or unix for that matter) login with a username and password from a mysql database. I want to make it to where a user from the mysql database can access the unix machine through the login screen that always presents itself after starting the computer. How do i make it to where I can use a username and password from the mysql server to login to the machine with through the login screen.

if logging in with a MySQL username and password isn't possible then is there a way to use a table containing a username and password to login to the computer that can communicate with the MySQL database server

Last edited by baronobeefdip; 08-31-2012 at 07:31 PM.
 
Old 08-31-2012, 07:34 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Try pam-mysql.
 
Old 08-31-2012, 07:49 PM   #3
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
How do I set it up (on the server and the client side). Plus in case that doesn't work is there another way besides pam-mysql. I also must mention that I am not configuring tables and databases through command line, I am editing the tables with LibreOffice BASE.
 
Old 08-31-2012, 08:03 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
First you install the pam-mysql module on the client. Unless you find a precompiled package, you'll have to compile it from source. Fortunately, this is dead easy (it usually is) provided your distribution has the necessary developer tools installed. The INSTALL file contains instructions on how to do this.

Then you have to tell PAM to use pam-mysql when authenticating users. This incolves editing the relevant file(s) in /etc/pam.d. You would look for a file with a name corresponding to the process that will authenticate your users (for instance "sshd"). The README file contains details on the modifications you'll have to make.

The README file also contains details on how to provide the name of the MySQL server, the credentials that are to be used to log in to the database, and the database name, table and columns that hold the usernames and passwords.

The tool used to create the MySQL database is of no significance.
 
Old 08-31-2012, 08:29 PM   #5
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
How do I add users and passwords, plus how do I change the passwords, and delete users from the databse. Since the passwords are hashed (I am assuming) There has to be a way to create the user's password somehow instead of just adding the user to the table manually.

The distribution I am using already has pam-mysql inside of the repo server (debian and ubuntu. unsure about redhat based distributions yet). now how do I connect it to the sql server (and I would like to know how to add users to the mysql server)

Last edited by baronobeefdip; 08-31-2012 at 08:36 PM.
 
Old 08-31-2012, 08:38 PM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
You can add users in Base if you so choose. Otherwise, you'll find useradd among the executables that have PAM configuration files. If you add pam-mysql to the "account" section, it should create users in the MySQL database. I would imagine the same goes for userdel (and any other tool or GUI used to add or delete user accounts).

If you add pam-mysql to the "password" section of the passwd PAM config file, you can update passwords from the command line. You can do the same with the PAM file for any other tool used to create or change passwords.

pam-mysql supports both hashed and non-hashed passwords. Look in the FAQ section on the web page for more information on this and other topics.
 
Old 08-31-2012, 08:42 PM   #7
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
I just changed the config file in /etc/pam-mysql.conf file to communicate (hopefully) with the mysql server. Now I need to know how to let the database communicate with the client. I have thought of the sql way of making it listen to incoming connections from certain clients but the problem with this method is that it only allows configuration for one user at a time and one host at a time. I want to make it to where all user requests will be accepted from any hosts without having to configure the database server to listen for them. I want to be able to setup a client somewhere and not configure the sql database to get it to accept communications from the client i just setup

Last edited by baronobeefdip; 08-31-2012 at 08:51 PM.
 
Old 08-31-2012, 08:51 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Download the zipped tar file with source code. The information you're looking for is in the README file.
 
Old 08-31-2012, 08:56 PM   #9
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Original Poster
Rep: Reputation: 32
I am looking at the table "user" and it is only allowing connections for root from the client, I want MySQL to accept connections for all of the users in the database from all addresses on the network (although I do want to make the root user only accessible from a certain machine in the network)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically login to Linux distro without entering username and password soroush Linux - General 3 10-21-2011 04:30 PM
How to find/recover Redhat Enterprise Linux 3 username & password for login fruitplus Linux - Newbie 1 05-07-2010 07:02 AM
Username and password to login Suse linux 10 honghoahoi Linux - General 4 01-20-2010 10:50 PM
username and password login Clarence27 Ubuntu 3 10-17-2006 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration