HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Login Script
Operating System - Linux
1828926
Members
2907
Online
109986
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2006 12:21 AM
09-22-2006 12:21 AM
Login Script
Hi
I am too new to scripting ..
I would like to enable a script to achive
whenever a user login it should ask new or old user.
If its new user he should be able to create a account on the system
If he is old user he should login to system
Need of a script to run on FC5 (Fedora Core 5)
Dinesh
RHCE# 807303594707347
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2006 12:44 AM
09-22-2006 12:44 AM
Re: Login Script
There's a problem with your desired setup.
A user must be root or the useradd/passwd commands must be setuid in order for regular user to create new accounts. You simply don't do it unless you wish to have a mess in your system.
Anyway if you want all your users to get the same message upon login - edit /etc/bashrc
append the following lines:
echo "Are you an old user?"
read answer
if [ $answer = "yes" ]; then
here comes your command
else
command to do if the user is old
fi
A user must be root or the useradd/passwd commands must be setuid in order for regular user to create new accounts. You simply don't do it unless you wish to have a mess in your system.
Anyway if you want all your users to get the same message upon login - edit /etc/bashrc
append the following lines:
echo "Are you an old user?"
read answer
if [ $answer = "yes" ]; then
here comes your command
else
command to do if the user is old
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2006 01:51 AM
09-22-2006 01:51 AM
Re: Login Script
to achieve non-interactive user addition (that can be used in script):
useradd user_name; echo "user_password" |passwd --stdin;
echo "Are you an old user"
read answer
if [ $answer = "yes" ]; then
useradd user_name; echo "user_password" |passwd --stdin;
fi
useradd user_name; echo "user_password" |passwd --stdin;
echo "Are you an old user"
read answer
if [ $answer = "yes" ]; then
useradd user_name; echo "user_password" |passwd --stdin;
fi
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP