Now it is time to add users to the machine. First, start off with the administrator account.
# kadmin.local kadmin.local: addprinc admin/admin@ Enter password for principal "admin/admin@ your_password Re-enter password for principal "admin/admin@ your_password Principal "admin/admin@YOUR_REALM" created.
Then create a keytab on the server. This will authenticate who can modify things on the server and who cannot. Make sure you place everything on one line (including kadmin/changepw):
kadmin.local: ktadd -k /etc/kadm5.keytab kadmin/admin kadmin/changepw Entry for principal kadmin/admin with kvno 3, encryption type DES-CBC-CRC added to keytab WRFILE:/etc/kadm5.keytab. Entry for principal kadmin/changepw with kvno 3, encryption type DES-CBC-CRC added to keytab WRFILE:/etc/kadm5.keytab.You should see something similar, but probably not identical. Then you have to add the necessary information to the server. Edit your /etc/inetd.conf and insert the following:
krb5_prop 754/tcp # Kerberos v5 slave propagation kerberos-adm 749/tcp # Kerberos v5 admin/chpwd kerberos-adm 749/udp # Kerberos v5 admin/chpwd kpasswd 761/tcp kpwd # Kerberos "passwd" -kfallNow, as root, restart inetd and run krb5kdc and kadmind. Congratulations, most of the pain is over. It took me eight hours to get here my first time trying this—hope you did better.
Now test it. A few commands to know about are kinit, klist and kdestory. These initialize your tickets which authorize you, list them and destroy them. (Yes, from the user's point of view, everything is fairly simple.) So try it out by doing a kinit admin/admin@YOUR_REALM
underground:~> kinit admin/admin Password for admin/admin@UNDER: underground:~> klist Ticket cache: /tmp/krb5cc_1000 Default principal: admin/admin@UNDER Valid starting Expires Service principal 08 May 98 15:04:45 09 May 98 01:04:43 krbtgt/UNDER@UNDER
If you got it to work this far, you are virtually done. Add yourself as a user. Run kadmin—it should ask you for a password, same as the one you typed in way back when you created kadmin/admin. The procedure for adding another user is just as simple. Each user is a “principal” (don't ask me where the name came from).
kadmin: addprinc Enter password for principal "user@ Re-enter password for principal "user@ Principal "user@YOUR_REALM" created.Should you make a mistake, just delete the principal like so:
kadmin: delprinc user@ Are you sure you want to delete the principal "user@ Principal "user@YOUR_REALM" deleted.Now test this out the same way you did the administrator. You should get a new ticket.
I still haven't explained how to use it, so here we go. In order for you to be able to use Kerberos encrypted services on a machine, it must satisfy the following:
It has a principal host/hostname@REALM on the server
It has the correct services set up.
It has a keytab file and has /etc/inetd.conf set up right.
The easiest way to try this out is to set up the server so that it will let you make encrypted connections, before you attempt to add other machines. The problem is that it is a bit different from setting up another machine. So we are going to say we want to have kerberized TELNET and FTP on the machine pepsi.kellogg.nwu.edu for this example. To do this, you need to satisfy the three requirements above.
Let's go over the first. You are going to need to install Kerberos on the machine you want to offer kerberized services on first. All this means is putting the binaries on the machine (in our example pepsi.kellogg.nwu.edu). So just go install the binaries. You can, if you want, just copy them over. Then copy your /etc/krb5.conf file from the KDC (server) and place it on the machine you are giving kerberized services (pepsi.kellogg.nwu.edu). From that machine, you must run kinit admin/admin. Then run kadmind from your machine (or in my case pepsi.kellogg.nwu.edu) and run the following commands:
kadmin: addprinc host/pepsi.kellogg.nwu.edu kadmin: addprinc telnet/pepsi.kellogg.nwu.edu kadmin: addprinc ftp/pepsi.kellogg.nwu.edu kadmin: ktadd host/pepsi.kellogg.nwu.edu telnet/pepsi.kellogg.nwu.edu ftp/pepsi.kellogg.nwu.edu
A quick explanation is in order. For each service you plan to offer that is kerberized, you must have a principal. Hence, the use of telnet and ftp with the addprinc command. Then you must make the keytab. That is done by issuing the ktadd command. All of this must be done on the machine, you are setting up to offer services (in this case pepsi.kellogg.nwu.edu).
Finally, edit your /etc/inetd.conf and add the following lines. You will want to comment out any previous definitions of telnet and ftp.
klogin stream tcp nowait root /krb5/sbin/klogind klogind -ki eklogin stream tcp nowait root /krb5/sbin/klogind klogind -eki kshell stream tcp nowait root /krb5/sbin/kshd kshd -ki telnet stream tcp nowait root /krb5/sbin/telnetd telnetd -a valid ftp stream tcp nowait root /krb5/sbin/ftpd -a
Go back to the main server and create yourself a ticket (kinit user@YOUR_REALM). Now make a user (see above addprinc command) for yourself and try to login using telnet like this:
underground:~> telnet -l cosimo pepsi Trying 184.108.40.206... Connected to pepsi.kellogg.nwu.edu (220.127.116.11). Escape character is '^]'. [ Kerberos V5 accepts you as "cosimo@UNDER" ] Last login: Fri May 8 13:44:44 on tty2 Linux 2.0.30. pepsi:~>Note how you didn't have to enter a password. That's okay, because the ticket gave you the access to the machine. The ticket does eventually expire, but it can be renewed by issuing a new kinit command. (Do a klist to see when it does expire. If you copied my /etc/krb5.conf, it will be 600 minutes.)
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- Stunnel Security for Oracle
- The Firebird Project's Firebird Relational Database
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- SUSE LLC's SUSE Manager
- Managing Linux Using Puppet
- My +1 Sword of Productivity
- Non-Linux FOSS: Caffeine!
- Google's SwiftShader Released
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide