Results 1 to 5 of 5

Thread: Run a Script with username and password at log-in???

  1. #1
    Join Date
    Jan 2010
    Beans
    28

    Run a Script with username and password at log-in???

    Dear all,
    My friend gave me a script which should be run with username and password as parameters to it. Since running this all the time as I log in is cumbersome and since there are few users of my system, I thought of asking this question. Is there any way that I could make a script run when a user logs in with the username and password the user enters as parameters? I've been searching for an answer for this problem through the internet and couldn't find it. Since many people claim that my written language is not clear enough, here's what I want to do in an example:

    Say I have a user called Alex with username alex and password abc123. When Alex logs in he types in his username and password in login screen. This information should be used to automatically run a script in the terminal as

    Code:
    $/home/my_script username:alex passwd:abc123
    My system is 64 bit xubuntu 12.04 desktop edition.

    Any suggestions will be appreciated. Thank you.

  2. #2
    prodigy_ is offline May the Ubuntu Be With You!
    Join Date
    Mar 2008
    Beans
    1,219

    Re: Run a Script with username and password at log-in???

    What is this script supposed to do?

    Normally you run scripts either under your own account in which case you don't need password or as root (e.g. from root's crontab or from /etc/rc.local). As root you can use sudo -u username construct without password.
    Last edited by prodigy_; April 16th, 2013 at 04:50 AM.

  3. #3
    Join Date
    Jan 2010
    Beans
    28

    Re: Run a Script with username and password at log-in???

    Well the script connects to a remote server (actually our geeks desktop) and retrieves files. Each one of us have an account in his desktop and each account has the same username and password as our accounts in my computer. That's why I need to run the script with username and passwords.

  4. #4
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Run a Script with username and password at log-in???

    If possible can you tell us how it connects to the remote server, (ssh/samba etc.) Then we might be able to help more.
    Catch me on Freenode - imark

  5. #5
    Join Date
    Jan 2010
    Beans
    28

    Re: Run a Script with username and password at log-in???

    Well, I'm a noob actually. My geek friend is not here anymore. But his machine is a Windows machine with active directory I guess.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •