- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- user login using shell script
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
07-28-2006 08:04 PM
07-28-2006 08:04 PM
user login using shell script
how can i login using shell svript?
I know i am able to do su - username
but how can I issue the password
suggestions !!!!
regards
rajeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2006 11:54 PM
07-28-2006 11:54 PM
Re: user login using shell script
If you wish to define a user account that when the user logins in, a particular script or executable file is always run, then you can define the executable as the shell program in '/etc/passwd'. That is, instead of the normal '/usr/bin/sh' (for instance), substitute your program.
If you need to run a particular program and pass some static parameters, place an 'exec' statement at the end of the user's profile, instead. For example:
# exec mything -f myfile
...when the profile is read by login, 'mything' wili become the user's running environment. When 'mything' exits, the user will be logged off. This applies similarly when declaring '/usr/local/bin/mything' as the program name in an account in '/etc/passwd'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2006 06:30 PM
07-29-2006 06:30 PM
Re: user login using shell script
Then you can use expect tool for it. You can get it on any of the HP porting centers. (http://hpux.connect.org.uk)
You may be able to use following code. Check it.
(sleep 2;echo "user_name";sleep 1;echo "user_password";sleep 2;echo "ls";echo "exit 0") | telnet â hostâ
{sleep 2;echo "user_name";sleep 1;echo "user_password";sleep 2;echo "ls";echo "exit 0" ; } | telnet "host"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2006 05:51 AM
08-02-2006 05:51 AM
Re: user login using shell script
O'Reilly has a book about programming in Expect:
http://www.oreilly.com/catalog/expect/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2006 07:31 AM
08-02-2006 07:31 AM
Re: user login using shell script
As root, you can 'su' to anyone's account without supplying a password.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2007 07:47 PM
05-21-2007 07:47 PM