Sponsored Content
Top Forums Programming Programming Forum - Check it out! Post 302232998 by ovais245 on Friday 5th of September 2008 07:01:05 PM
Old 09-05-2008
"" need this code in C language for UNIX"
Write or study a small program that mimics the most common login procedures in UNIX.
You have two options here. Either, you write it yourself according to the specification
below, or you copy the file
/cab/cestud/work/edu/course/EDA263_Computer_Security/
lib/login_linux/login_linux.c into your home directory. If you choose to write
it yourself the following should be implemented.
- The program begins with displaying ”login:” and takes the username as input.

- Then the program writes ”Password:” and waits for the password to be entered,
which should not be visible on the terminal (use the function getpass(3) that
among other things will see to that the text is not ”echoed” on the terminal).
- The program queries the system’s user database to see if the username exists. If
this is the case it encrypts the entered password (with a known algorithm) and
ensures it corresponds to the stored encrypted password belonging to the actual
user. Suitable library routines are getpwnam(3), crypt(3) and strncmp(3).
- If the username does not exist, or if the password is wrong, the program displays
”Login incorrect” and restarts from the beginning, otherwise it writes something
like ”Welcome to this System!” and terminates.
Test that your program works by compiling and running it.
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check lists for Unix Shell Programming

Hi all, Can anyone provide me any checklists or a list of steps I should follow before executing my scripts. Could also tell me if there are any other standards to be followed while shell programming like naming conventions for variables etc. Your help would be much appreciated. Regards,... (2 Replies)
Discussion started by: srikanth_ksv
2 Replies

2. Shell Programming and Scripting

Check any MQ is up or down using shell programming

Hi, I want to know that if there are any methods, which check the MQ, is up or down. Actually I have to write one job which checks the status of any one MQ is up or down. I don't know if there is any method of MQ, which tells the MQ, is up. Could u please give some link for the study... (1 Reply)
Discussion started by: rinku
1 Replies

3. UNIX for Dummies Questions & Answers

Carreer:Networking Programming in Unix (C programming Language)

Hello, I am trying to learn Networking Programming in C in unix enviorment. I want to know how good it is to become a network programmer. i am crazy about Network programming but i also want to opt for the best carreer options. Anybody experienced Network Programmer, please tell me is my... (5 Replies)
Discussion started by: vibhory2j
5 Replies

4. What is on Your Mind?

Forum Update: Disabled Home Page Forum Statistics for Guests (Not Registered)

Just a quick update; to speed up the forums, I have disabled the forum statistics on the home page for non registered users. No changes for registered users. (0 Replies)
Discussion started by: Neo
0 Replies

5. Post Here to Contact Site Administrators and Moderators

Is it possible to add Python in the description of Shell Programming and Scripting of this forum?

https://www.unix.com/shell-programming-and-scripting/ The current description of Shell Programming and Scripting has: Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here. Perl, php are there. Is it possible to add PYTHON there too? (3 Replies)
Discussion started by: cola
3 Replies

6. What is on Your Mind?

Mobile: Advanced Forum Statistics to Forum Home Page

For mobile users, I have just added a "first beta" Advanced Forum Statistics to the home page on mobile using CSS overflow:auto; so you can swipe if you need to see more. Google Search Console mobile usability says this page is "mobile friendly" so perhaps this will be useful for some of our... (12 Replies)
Discussion started by: Neo
12 Replies
yppasswd(1)							   User Commands						       yppasswd(1)

NAME
yppasswd - change your network password in the NIS database SYNOPSIS
yppasswd [username] DESCRIPTION
The yppasswd utility changes the network password associated with the user username in the Network Information Service (NIS) database. If the user has done a keylogin(1), and a publickey/secretkey pair exists for the user in the NIS publickey.byname map, yppasswd also re- encrypts the secretkey with the new password. The NIS password may be different from the local one on your own machine. yppasswd prompts for the old NIS password, and then for the new one. You must type in the old password correctly for the change to take effect. The new password must be typed twice, to forestall mistakes. New passwords must be at least four characters long, if they use a sufficiently rich alphabet, and at least six characters long if mono- case. These rules are relaxed if you are insistent enough. Only the owner of the name or the super-user may change a password; superuser on the root master will not be prompted for the old password, and does not need to follow password construction requirements. The NIS password daemon, rpc.yppasswdd must be running on your NIS server in order for the new password to take effect. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
keylogin(1), login(1), nis+(1), nispasswd(1), passwd(1), getpwnam(3C), getspnam(3C), secure_rpc(3NSL), nsswitch.conf(4), attributes(5) WARNINGS
Even after the user has successfully changed his or her password using this command, the subsequent login(1) using the new password will be successful only if the user's password and shadow information is obtained from NIS. See getpwnam(3C), getspnam(3C), and nsswitch.conf(4). NOTES
The use of yppasswd is discouraged, as it is now only a wrapper around the passwd(1) command, which should be used instead. Using passwd(1) with the -r nis option (see nis+(1)) will achieve the same results, and will be consistent across all the different name services avail- able. BUGS
The update protocol passes all the information to the server in one RPC call, without ever looking at it. Thus, if you type your old pass- word incorrectly, you will not be notified until after you have entered your new password. SunOS 5.10 28 Nov 2001 yppasswd(1)
All times are GMT -4. The time now is 03:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy