Terminal command to login a user

I'm doing some work on a lab, and it part of the process involves logging out the user. To complete the installation, I need to log back in as the user. ARD let's let send a command to log out a user, but is there a terminal command to login a user? I've tried using login -f username, but that didn't work.

To login as administrator:hello
I use:
osascript <<EOF
tell application "System Events"
keystroke "administrator"
keystroke tab
delay 0.5
keystroke "hello"
delay 0.5
keystroke return
keystroke return
end tell
EOF
You can save it as a task and double-click and drag in the computers and run when you want to do it.

Similar Messages

  • Running Terminal Commands at Login

    Hi everyone!
    Just a quick question for anyone who may know the answer. I am trying to automatically run two terminal commands at login:
    sudo pmset -a halfdim 0
    sudo pmset -a halfdim 1
    I have absolutely no idea what I am doing, so if someone knows and can help me out, that would be great! Thanks a lot!
    ~ Philip

    Trying to make the screen wink at you when you login?
    You could install Platypus and create a little shell script with it and put it in your Login items. The script would be something like
    <pre class=command>sleep 30; sudo pmset -a halfdim 0; sleep 0.2; sudo pmset -a halfdim 1</pre>
    Those sleeps should be tweaked for the best effect. If sudo prompts you for a password, then it won't work.
    Message was edited by: jarik
    Hey man, check out the day we registered here!

  • Terminal Command to Log Out User

    I have Fast User Switching enabled. I would like to log users out that forgot to log out. What are the Terminal commands to log out someone named Alice who is a Standard user in OS X.3.9? I'm getting tired of having to restart to shut down the users account. Will the commands be the same for an Administrators account?
    Thanks for your help,
    G4 Quicksilver Dual 1 GHz, 1.5 GB RAM, Sonnet ATA133 card, Maxtor ATA133 drives   Mac OS X (10.3.9)   B+W G3 450 MHz, OS 9.2.2, 1 GB RAM

    If you're the Admin, then you should be able to use Terminal as root to log someone out like this:
    sudo killall -u [username]
    This should kill all processes in that user account, and it may log them out also (I can't test this on a single user machine). If it doesn't, you can use:
    sudo shutdown now
    which will log out everyone and shutdown the system to single-user mode for the root/Admin user.
    Hope this helps,
    Mulder
    If my answer helped solve your problem, please consider awarding some points. Why Reward Points?
    iMac G4 700Mhz   Mac OS X (10.3.9)  

  • Hey,i forgot my login password,so i changed the password by using terminal command(reset password).now i have new user name with new password,but i can't find  my data which i have saved on mac.please help me out in this matter.

    hey,i forgot my login password,so i changed the password by using terminal command(reset password).now i have new user name with new password,
    but i can't find  my data which i have saved on mac.the storage is showing data used and free space on the disk
    please help me out in this matter.

    How did you change your user name?
    resetpassword wouldn't have done it. If you managed to create a new user, then your data is still in the old account.

  • How to login in command line by adding user/password in the same line

    is it possible in OSX to login in terminal by typing:
    +login username password+
    I tried many unix command and never find a command that can do that in one line, it always ask for the password in the second line.
    I need that to be used in Python application,
    or if there any possibility to write code in python to do that in OSX using python osx modules,
    while in windows it worked perfect by using win32API in Python.
    I hope Apple developers can help me with That
    Thanks

    This isn't possible because it would be a terrible security vulnerability--any process on the system can see a program's command line arguments. (Just type "perl -e 'sleep 5' & ps" in a terminal if you don't believe me.) If you want to log in like this, you'll have to open the "login" program in such a way that you can give it the password through its standard input.
    Also note, however, that "login" will not change the account your Python program is running as; it just starts a shell running as that account. If you want your program to run as a different user, you need to look into a set of commands and techniques called "setuid" or just "suid"; a Google search for "setuid python" should get you started. (I'm not a Python programmer, so I can't really tell you exactly how setuid works in Python.)

  • Inadvertently deleted user folder with terminal command - HELP!

    Hi
    I was using terminal to delete my hosts file using the following command:
    sudo rm -rf /Users/xxx/.ssh/known_hosts
    Unfortunalely, I misplaced a space after the username, and deleted most of my user files. I thought something weird was happening when all the desktop icons dissappeared, and restarted immediately.
    Now I am missing all of my docs, and desktop files. Some things are preserved, like itunes library and iPhoto library. My backup is over 6 months old.
    I took out the hdd, put in an external enclosure, and hooked it up to another SL machine. I ran stellar phoenix overnight, but the recovered files all seem to be weird system files, mostly .plist files, nothing recent.
    Any suggestions?
    Thanks

    ro-76 wrote:
    Thanks for the reply.
    My main backup is over 6 months old.
    then I suggest you start backing up regularly. there is no excuse not to do it.
    I use dropbox to backup the stuff I'm working on at the moment, but not the older stuff.
    I found it strange that I could not recover anything with Stellar Phoenix. Is there something special about deleting using terminal? Does it completely erase the file?
    not unless you use srm which you didn't. but NOT data recover software as you tried is perfect nor can it be expected to be. when you delete a file either from finder or from terminal it's unlinked from the directory but the actual space it's stored on the drive is not immediately overwritten by new data. that's what makes data recovery even possible. however, from that moment on it's treated as free space and can be overwritten at any instant. as soon as this happens data recovery becomes impossible. the only true way to protect your data is to *back up*.
    I'll try Data Rescue 3.

  • I used a terminal command to show the Library in the User folder, and now the Finder is behaving erractically.  Can anyone tell me how to reverse the show library terminal command?

    I used a terminal command in Lion to show the LIbrary in the Users folder, and now the Finder is behaving erratically, hanging up and becoming almost paralyzed.  Can anyone tell me how to reverse the terminal command for show Library.  The command I used was:
    chflags nohidden ~/Library/

    Showing the Library folder will not cause the problem you've described. Nevertheless:
    chflags hidden ~/Library
    will hide the folder. To reveal the folder:
    chflags nohidden ~/Library
    Note, there is no "/" after Library.

  • Create terminal command shortcut icon

    Hello,
    If someone would be kind enough to help me out with creating a shortcut terminal command that would be great. I was messing around with the Android SDK just for fun and was wondering how you can get it to launch a specific avd, so from Terminal I would type
    /user/myaccount/applications/andriod/tools/emulator -avd Android-2.3.3
    And it would open, how would you create a shortcut on the desktop to do this so I can just double click and it will open? In windows I would just modify the target and add the -avd or create a batch file, but not sure how to do this in OSX.
    Thanks

    so in text editor I put this line which if I open terminal and paste it will launch the emulator.
    /Applications/Android-Emulator/tools/emulator -avd Android-2.3.3
    saved the file, then did a chmod +x ./filename
    change the extention to .command
    When I double click I get an error
    Last login: Thu Jul 14 21:24:12 on ttys000
    /Users/Me/Desktop/Android.command ; exit;
    MacBook-Pro:~ me$ /Users/Me/Desktop/Android.command ; exit;
    /Users/me/Desktop/Android.command: line 1: {rtf1ansiansicpg1252cocoartf1038cocoasubrtf360: command not found
    /Users/me/Desktop/Android.command: line 2: syntax error near unexpected token `}'
    /Users/me/Desktop/Android.command: line 2: `{\fonttbl\f0\fswiss\fcharset0 Helvetica;}'
    logout

  • Filevault encryption paused, despite reset of PRAM and using terminal commands

    I have been trying to partition my HDD but am unable to because file vault encryption is paused - and has been since October 2014.
    I attempted making a new user to see if this would bypass it, but it didn't.
    I have reset the PRAM and have repaired the HDD both in recovery and normal, neither work.
    I have also used terminal command "sudo fdesetup disable" to attempt turning it off, but that doesn't work either.
    Help please??
    Harry

    If you don't already have a current backup of all data, back up before proceeding. There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    Start up in Recovery mode. When the OS X Utilities screen appears, select Disk Utility.
    In the Disk Utility window, select the icon of the startup volume from the list on the left. It will be nested below another disk icon, usually with the same name. Click the Unlock button in the toolbar. When prompted, enter the login password of a user authorized to unlock the volume, or the alternate decryption key that was generated when you activated FileVault.
    Then, from the menu bar, select
              File ▹ Turn Off Encryption
    Enter the password again.
    You can then restart as usual, if the system is working. Decryption will be completed in the background. It may take several hours, and during that time performance will be reduced.
    If you can't turn off encryption in Disk Utility because the menu item is grayed out, you'll have to erase the volume and then restore the data from a backup. Select the Erase tab, and then select
              Mac OS Extended (Journaled)
    from the Format menu.
    You can then quit to be returned to the main Recovery screen. Follow these instructions if you back up with Time Machine. If you use other backup software, follow its developer's instructions.
    Don't erase the volume unless you have at least two complete, independent backups. One is not enough to be safe.

  • Executing terminal command at startup

    What is the easiest way to execute a terminal command when OSX starts up?

    OS X has used Launchd to run startup items since Tiger (10.4). Create a .plist for the program
    you want to run and putting it in the /Library/launchAgents or the $HOME/Library/LaunchAgents
    directory, if you only want it to run at user login. Optionally, for user startup items, you can add
    the command to the Account login items, but it has to be in the form of a standalone unix script
    or automator app to work correctly as an Account login item.
    Here are some background resources on launchd:
    http://www.macgeekery.com/tips/allabout_launchd_items_and_how_to_make_oneyourself
    http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemS tartup/Articles/LaunchOnDemandDaemons.html
    http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/m an5/launchd.plist.5.html
    Here is a Gui app that can help you create launchd items:
    http://sourceforge.net/projects/lingon/files/
    Here is a thread on using Account login items to launch scripts and automator apps:
    http://discussions.apple.com/message.jspa?messageID=11569184#11569184
    Now, go start something.

  • I get "App Store Disabled" on my MacBook Pro due to profile issues. What Terminal command can I use to reset profile settings?

    After transferring documents from one MacBook Pro to another I get some weird errors due to settings that seem to have transferred over. One is that the Mac App Store is disabled.
    Are there any Unix / Terminal commands I can use to reset these?

    Forgot Your Account Password
    For Lion/Mountain Lion
        Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
         When the menubar appears select Terminal from the Utilities menu.
         Enter resetpassword at the prompt and press RETURN. Follow
         instructions in the dialog window that will appear.
         Or see Reset a Mac OS X 10.7 Lion Password and
         OS X Lion- Apple ID can be used to reset your user account password.

  • How to make Apple Script do a terminal command

    Hey,
    I am wondering how can I make an AppleScript do the following command :
    "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4"
    Please mention step by step since I'm new to AppleScript
    Best Regards,
    Nadav.

    To run a terminal command it is usually sufficient to use do shell script. So for your command it would be
    do shell script "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4"
    note if the command requires administrator privileges you would need to do
    do shell script "command"  with administrator privileges
    will prompt for the password when the script is run.
    do shell script "command" user name "me" password "mypassword" with administrator privileges
    will store the password and username in the script. More convenient but much less secure.
    See do shell script in AppleScript

  • I didn't find configure terminal command in the ios of aironet 1131AG

    Dear All
    i bought cisco aironet 1131AG yesterday. when the AP get IP from DHCP and trying to access it by internet browser, the web page is empty so i tried to access AP by console and login in to the privileged mode but i did't find the configure terminal command to enter the config mode.
    what is the problem !!!???
    is the IOS version problem?
    the details of show version command :
    Cisco IOS Software, C1130 Software (C1130-RCVK9W8-M), Version 12.3(11)JX1, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2006 by Cisco Systems, Inc.
    Compiled Mon 17-Jul-06 11:38 by alnguyen
    ROM: Bootstrap program is C1130 boot loader
    BOOTLDR: C1130 Boot Loader (C1130-BOOT-M) Version 12.3(8)JEA, RELEASE SOFTWARE (fc2)
    AP001e.7abd.dca6 uptime is 3 hours, 9 minutes
    System returned to ROM by power-on
    System image file is "flash:/c1130-rcvk9w8-mx/c1130-rcvk9w8-mx"
    cisco AIR-LAP1131AG-A-K9   (PowerPCElvis) processor (revision A0) with 24566K/8192K bytes of memory.
    Processor board ID FOC12072A3U
    PowerPCElvis CPU at 262Mhz, revision number 0x0950
    Last reset from power-on
    LWAPP image version 3.0.51.0
    1 FastEthernet interface
    32K bytes of flash-simulated non-volatile configuration memory.
    Base ethernet MAC Address: 00:1E:7A:BD:DC:A6
    Part Number                          : 73-8962-12
    PCA Assembly Number                  : 800-24818-11
    PCA Revision Number                  : B0
    PCB Serial Number                    : FOC12072A3U
    Top Assembly Part Number             : 800-29144-02
    Top Assembly Serial Number           : FOC12072A3U
    Top Revision Number                  : A0
    Product/Model Number                 : AIR-LAP1131AG-A-K9
    Configuration register is 0xF

    Hi,
    The APs image is LWAPP and to access the config t command we need to convert the IOS to Autonomous.. here is the step by step procedure that we need to follow to get the issue resolved..
    C1130 Software (C1130-RCVK9W8-M)
    I request you to do download any image from the below link and perform the conversion from LWAPP image to autonomous..
    http://www.cisco.com/cisco/software/release.html?mdfid=279537722&flowid=6775&softwareid=280805680&release=12.4.25d-JA&rellifecycle=ED&relind=AVAILABLE&reltype=latest
    the method to convert is..
    download TFTPd32 from google and install it on ur PC.. point the image that you have downloaded in the TFTP server..
    connect  a ethernet cable between ur laptop and AP.. both should be in the same  subnet.. and connect a console cable and get the hyperterminal console  access and issue the command..
    AP>en
    AP#debug lwapp console cli or debug capwap console cli
    AP#config t
    AP(confg)int fa 0
    AP(confg-if)ip addr (same subnet as that of the laptop)
    AP(confg-if)end
    AP#archieve download-sw /force-reload /overwrite tftp:///
    eg-
    Assuming tftp ip address is 10.0.0.1 and the image is c1130-k9w7-tar.124-25d.JA.tar, then..
    AP#archieve download-sw /force-reload /overwrite tftp://10.0.0.1/c1130-k9w7-tar.124-25d.JA.tar
    The AP will reload and it will come up with IOS image and you will be able to enter the config mode
    lemme know if this answered your question..
    Regards
    Surendra
    ====
    Please dont forget to rate the posts which answered your question and mark it as answered or was helpfull

  • Is there a terminal command that will close quicktime player once a video is finished?

    I'm running a python program that uses subprocess.call(['open', '-a', "Quicktime Player", filename]) to open a video and defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen 1 starts it automatically. I'm wondering if there's a terminal way or a python way to close the video once it's finished.

    Hi, Thanks for the reply, I appreciate it.
    What do you mean by "pick up"?
    I mean to show what the DNS numbers are that the router is using.
    They are not entered in the DNS server field in Networks, TCP/IP tab.
    If you mean refresh the client settings, the DNS settings are obtained as part of the DHCP lease (or PPP connection in the case of PPP).
    The user/ OP is actually using PPPoA, when i googled PPPoA.. seems he is using Cisco perhaps.
    http://en.wikipedia.org/wiki/Point-to-PointProtocol_overATM (Asynchronous Transfer Mode)
    "PPPOA or PPPoA, Point-to-Point Protocol (PPP) over ATM, is a network protocol for encapsulating PPP frames in ATM AAL5. It is used mainly with cable modem, DSL and ADSL services.
    It offers standard PPP features such as authentication, encryption, and compression. If it is used as the connection encapsulation method on an ATM based network it can reduce overhead slightly (around 0.58%) in comparison to PPPoE".
    Essentially the original poster removed the OpenDNS #s from his DNS server field in the TCP/IP tab (b/c they seem to make Adobe.com inaccessible to him)
    removing them & allowing his router to "pick them up from the ISP" seems to solved his problem.
    However he can not, find what the numbers are that are being utilized,
    b/c they are not entered as usual in the Network, & part of the DHCP lease,
    or in Airport admin Utility.
    I/ we wondered, if there was a Terminal command that will show what the
    numbers are that are being used .
    Does that help clarify what I mean? Sorry to be so long winded.
    Eme '~[ )♥♪

  • Is there a Terminal command that will pick up DNS numbers?

    Hello all,
    Is there a Terminal command that will pick up the DNS numbers utilized by a router?
    The router options don't show any, though the router is set to use PPPoA to pick them up.
    I kindly TIA,
    Eme '~[ )♥♪

    Hi, Thanks for the reply, I appreciate it.
    What do you mean by "pick up"?
    I mean to show what the DNS numbers are that the router is using.
    They are not entered in the DNS server field in Networks, TCP/IP tab.
    If you mean refresh the client settings, the DNS settings are obtained as part of the DHCP lease (or PPP connection in the case of PPP).
    The user/ OP is actually using PPPoA, when i googled PPPoA.. seems he is using Cisco perhaps.
    http://en.wikipedia.org/wiki/Point-to-PointProtocol_overATM (Asynchronous Transfer Mode)
    "PPPOA or PPPoA, Point-to-Point Protocol (PPP) over ATM, is a network protocol for encapsulating PPP frames in ATM AAL5. It is used mainly with cable modem, DSL and ADSL services.
    It offers standard PPP features such as authentication, encryption, and compression. If it is used as the connection encapsulation method on an ATM based network it can reduce overhead slightly (around 0.58%) in comparison to PPPoE".
    Essentially the original poster removed the OpenDNS #s from his DNS server field in the TCP/IP tab (b/c they seem to make Adobe.com inaccessible to him)
    removing them & allowing his router to "pick them up from the ISP" seems to solved his problem.
    However he can not, find what the numbers are that are being utilized,
    b/c they are not entered as usual in the Network, & part of the DHCP lease,
    or in Airport admin Utility.
    I/ we wondered, if there was a Terminal command that will show what the
    numbers are that are being used .
    Does that help clarify what I mean? Sorry to be so long winded.
    Eme '~[ )♥♪

Maybe you are looking for

  • Error coming while deploying portal EAR file into the weblogic Portal 8.1..

    HI Guys, When I deploy the latest PORTAL EAR file into the BEA portal environment we receive a number of these errors: ####<Feb 27, 2008 4:36:14 PM PST> <Warning> <netuix> <dev147> <portalName> <ExecuteThread: '0' for queue: 'weblogic.kernel.System'>

  • I can't drag and drop my songs from mp3 rocket to my iphone?

    i have my mp3 rocket account linked to my itunes account and some songs get put onto my phone, but some dont. i can't drag and drop and if i try to rename it with correct characters, nothing happens. the mp3 rocket folder is in music under shared lib

  • Deleted or trashed emails reappearing in All Mail

    When I trash or delete a mail message from Apple Mail it never really goes away.  It is temporarily deleted but then shows up in my "All Mail" account.  If I use Gmail directly for this imap account it works.  But not when I use Apple mail.  Problem

  • Loggin to user in portal

    HI We have requirements to log on all pages user visit in SAP portal and all links it clicks. In other words whatever user does once he log on to portal. Is there any place where such a logging is done? or any configuration setting which can be turne

  • How do I get the bean property to JSP page for use in a Scriplet

    Hi all, I am new to JSF and would like to know how can I get the Bean property to a JSP page and then use that property to dynamically display the contents. Thank in advance,