Using launchctl via SSH

Hello everyone. Here's my situation:
I'm running Leopard Server 10.5.8.
Recently I made a plist file to put in my users's ~/Library/LaunchAgents folder. It runs an applescript at regular intervals throughout the day. Occasionally I need to stop and relaunch it, which I do using launchctl load ~/Library/LaunchAgents/nameofplist. (or unload, respectively.) This works fine when I'm logged in to the computer using my user's account, which is an admin account. BUT I want to do it via SSH instead. My user's account does not have access to SSH (for a good reason), so I use a special network user account for that. I SSH login remotely via Terminal, and then I type login username using my username and password. Then when I try the launchctl load command, I get this error:
launch_msg(): Socket is not connected
Does anyone know how I can get launchctl to work over SSH?

LittleSaint wrote:
Why would applescript be the problem? As long as it was compiled as a script and not an application, it should work just fine from a shell.
Not all shells are equal. An ssh-only connection does not have access to the Aqua user interface.
In Snow Leopard, the behavior seems to be different than before. It tries harder to find an Aqua session to run against. Before, I could just ssh from the Terminal and verify that my command line applications would or would not work. Now, even if I ssh from another account, if my original account is still logged in, I can still launch applications. I have to logout of my original account, login to a new account, ssh back to the original account and then try
[jdaniel@pele:506] ~/Desktop $ osascript testit.scpt
testit.scpt: execution error: An error of type -10810 has occurred. (-10810)
in order to get the desired failure.
Also, you have to actually access something in Aqua before it fails. The above error just comes from activating Address Book. If I take that out and just do 'set thename to "Hello"' it works fine. Of course, I don't know what you can do in AppleScript without telling some Aqua application to do it.

Similar Messages

  • Howto escape spaces in pathes when using rsync via ssh?

    Hi,
    I'm using rsync to sync my Addressbook's data from my PB to the cube where my iPod is connected to and syncs to that data. I've also set up ssh to connect to the cube and vice versa. Problem is, the path to the address book data contains a white space (Application Support). I escape it using a backslash on both the local and the remote path in the rsync command. It works with the local path but not with the remote one where it becames a 'real' space, so that rsync creates a new folder ~/Library/Application and copies everything over there. Any suggestions what's going on and how to solve it?
    (I remember I read something about the oddities of terminal - back when Panther came out - also scratching those kinds of issues, but don't remember where this was and yes, I've a workaround using a spaceless symlink at the cube, but I'd like to solve it within the rsync command. The symlink is just ugly).
    PowerBook 12   Mac OS X (10.4.6)  

    Hello Denis,
    Enclose the Path with double quotes and escape the whitespace with a backslash:
    with ssh, it works for me like:
    scp user@remote-host:"/Library/Application\ Support/test.nix" .
    works with rsync too this way.

  • Using a CVS repository via ssh from a Windows Machine

    I'm trying to set up a connection
    via ssh to a CVS repository (on Linux) with JDev 9.0.5.1
    (build 1605) on Windows. I'd like to use password to
    authenticate myself to CVS repository.
    Shay Shmeltzer pointed me to
    http://helponline.oracle.com/jdeveloper/help/state?navSetId=jdeveloper&navId=4&vtTopicId=&vtTopicFile=jdeveloper/using_support_for_tbd/scm_p_settingupcvs.html
    The solution explained there need access to the remote
    server in order to insert the key in authorized_keys,
    and we don't have this kind of access (the CVS repository
    is not mantained by our company).
    Do you think JDev will support password authentication
    for CVS/ssh in some future release?
    We're currently using WinCVS Client to access that
    repository, and each time we connect to the
    repository, a DOS windows appears asking us the password.
    I guess that this could be a solution.
    Thanks
    --luca

    We used to try to support popuping up the console, but that never worked too well from Java.
    Here's some thoughts on the matter from an article at http://www.devguy.com/fp/cfgmgmt/cvs/cvs_ssh.htm
    Hiding Your Password without Public Keys
    If you want to avoid typing your password at the command line for each operation and don't have the ability to put your public key on the SSH server...
    1. Create the following one-line Perl script and save it as my_ssh_cvs.pl
    system("plink.exe", "-ssh", "-pw", "YOURPASSWORD", @ARGV);
    2. Use PERL2EXE or ActiveState's perldevkit (perlapp -f my_ssh_cvs.pl) to create an executable from the script, e.g., my_ssh_cvs.exe
    3. Delete my_ssh_cvs.pl
    4. Run WinCVS
    5. Select Admin/Preferences...
    6. Click Settings... (for the ssh protocol)
    7. Click "If ssh is not in the PATH" and enter my_ssh_cvs.exe
    8. For "additional SSH options", leave it blank
    (however use the external locator in the connection wizard in JDeveloper to locate the my_ssh_cvs.exe)
    (note: this isn't officially suppported nor endorsed)
    Rob
    Team JDev

  • Not able to login to FWSM via SSH client

    When i am trying to login to FWSM via SSH client and it is throwing an error that "SSH server rejected your password Try again"

    Hello,
    Not sure how you want me to help. The error says it all! The password is wrong.
    Do you have any other username/password that you could use to connect and change yours as it looks you forgot it. Otherwise try to access it via console and change it.
    Regards.
    Jcarvaja
    Senior Network Security and Core Specialist
    CCIE #42930, 2-CCNP, JNCIS-SEC
    For inmediate assistance hire us at http://inetworks.cr/our-rates/

  • Forms6i via ssh F-Keys

    Hi folks,
    a remote server-forms6-application is accessed from a local Linux via ssh/xterm.
    The problem is the assignment of the function-keys. Per default ORACLE_TERM=vt220.
    How can I tell ORACLE to use xterm function keycodes?
    Or do I have to config xterm (e.g. with xkeycaps) to send codes like a vt220?
    Thanks for reading and komments
    Wolfgang

    Do they work if you hold the FN key down when pressing the function keys?
    If so, you need to go to System Preferences, Keyboard and un-check the box which says 'Use all F1, E2 etc. keys as standard function keys'

  • Bug between JRockit and X11 forwarding via ssh

    I have encountered what appears to be a bug in the interaction of JRockit with X11 ssh forwarding.
    When running any Java GUI application on a remote machine using X11 forwarding via ssh, a variety of problems occur. For example:
    --- cut here ---
    % mitrion-ide
    The program '' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadAtom (invalid Atom parameter)'.
      (Details: serial 189 error_code 5 request_code 20 minor_code 0)
      (Note to programmers: normally, X errors are reported asynchronously;
       that is, you will receive the error a while after causing it.
       To debug your program, run it with the --sync command line
       option to change this behavior. You can then get a meaningful
       backtrace from your debugger if you break on the gdk_x_error() function.)
    --- cut here ---That's the good case. When running the rmmlite application (available at https://rmml.dev.java.net/servlets/ProjectDocumentList?folderID=437&expandFolder=437&folderID=438 ), I experience what appears to be a near-lockup of my local workstation.
    Neither of these problems occur if I set my DISPLAY to not use ssh X11 forwarding. Likewise, non-Java applications work just fine with ssh X11 forwarding. Therefore the problem seems to be limited to the Java + ssh X11 forwarding combination.
    I have a suitable workaround (i.e. setting the DISPLAY variable to avoid ssh X11 forwarding), but I thought this was worth bringing to BEA's attention. I'd also be curious to know if others have run into similar difficulties.
    Here are the configuration details:
    Remote X11 client (where applications are hosted)
    =================================================
    % java -version
    java version "1.4.2_12"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
    BEA JRockit(R) (build R27.1.0-109-73164-1.4.2_12-20061129-1418-linux-ia32, compiled mode)
    % uname -a
    Linux earthling 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686 athlon i386 GNU/Linux
    % rpm -qa | grep openssh-server
    openssh-server-3.9p1-8.RHEL4.12
    This is a vanilla RedHat Linux RHEL 4 Update 3 system, with all other versions of Java removed.
    Local workstation (i.e. X11 server)
    ===================================
    % uname -a
    FreeBSD somewhere.sgi.com 6.2-RELEASE FreeBSD 6.2-RELEASE #5: Mon Jan 15 08:41:01 CST 2007 [email protected]:/usr/obj/usr/src/sys/somewhere i386
    % ssh -v
    OpenSSH_4.5p1 FreeBSD-20061110, OpenSSL 0.9.7e-p1 25 Oct 2004
    % pkg_info -Ix xorg-server
    xorg-server-6.9.0_3 X.Org X server and related programs
    Thank you,
    Brent Casavant

    Brent,
    it would be nice to know if this problem is specific to the JRockit JDK or
    if you also can reproduce it using the corresponding Sun JDK 1.4.2. Please
    do also try with a later version such as latest JRockit JDK 5.0.
    Thanks
    /Robert
    <Brent Casavant> wrote in message news:[email protected]...
    I have encountered what appears to be a bug in the interaction of JRockit
    with X11 ssh forwarding.
    When running any Java GUI application on a remote machine using X11
    forwarding via ssh, a variety of problems occur. For example:
    --- cut here ---
    % mitrion-ide
    The program '' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadAtom (invalid Atom parameter)'.
      (Details: serial 189 error_code 5 request_code 20 minor_code 0)
      (Note to programmers: normally, X errors are reported asynchronously;
       that is, you will receive the error a while after causing it.
       To debug your program, run it with the --sync command line
       option to change this behavior. You can then get a meaningful
       backtrace from your debugger if you break on the gdk_x_error() function.)
    --- cut here ---That's the good case. When running the rmmlite application (available at
    https://rmml.dev.java.net/servlets/ProjectDocumentList?folderID=437&expandFolder=437&folderID=438 )
    , I experience what appears to be a near-lockup of my local workstation.
    Neither of these problems occur if I set my DISPLAY to not use ssh X11
    forwarding. Likewise, non-Java applications work just fine with ssh X11
    forwarding. Therefore the problem seems to be limited to the Java + ssh X11
    forwarding combination.
    I have a suitable workaround (i.e. setting the DISPLAY variable to avoid ssh
    X11 forwarding), but I thought this was worth bringing to BEA's attention.
    I'd also be curious to know if others have run into similar difficulties.
    Here are the configuration details:
    Remote X11 client (where applications are hosted)
    =================================================
    % java -version
    java version "1.4.2_12"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03)
    BEA JRockit(R) (build R27.1.0-109-73164-1.4.2_12-20061129-1418-linux-ia32,
    compiled mode)
    % uname -a
    Linux earthling 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686
    athlon i386 GNU/Linux
    % rpm -qa | grep openssh-server
    openssh-server-3.9p1-8.RHEL4.12
    This is a vanilla RedHat Linux RHEL 4 Update 3 system, with all other
    versions of Java removed.
    Local workstation (i.e. X11 server)
    ===================================
    % uname -a
    FreeBSD somewhere.sgi.com 6.2-RELEASE FreeBSD 6.2-RELEASE #5: Mon Jan 15
    08:41:01 CST 2007
    [email protected]:/usr/obj/usr/src/sys/somewhere i386
    % ssh -v
    OpenSSH_4.5p1 FreeBSD-20061110, OpenSSL 0.9.7e-p1 25 Oct 2004
    % pkg_info -Ix xorg-server
    xorg-server-6.9.0_3 X.Org X server and related programs
    Thank you,
    Brent Casavant

  • How to Install AIR on Linux via SSH

    How can I install AIR on a linux server via SSH?
    llama

    Hi llama,
    As installing AIR requires a running xserver on linux. So you can install using ssh by providing -Y parameter.
    so connect to your server in the way, e.g: ssh -Y user@server and then perform the installation.
    Regards
    Syed

  • Accessing Disabled Accounts via ssh

    We have user accounts on our OS X Tiger Server where the user has installed a public key into their ~/.ssh/authorized_keys file.
    The problem:
    If I uncheck "access account" in Workgroup Manager for one of those users, they can still login to the server via ssh, authenticating with their private key.
    So, how can I truly disable access to an account that has a key pair installed for ssh?
      Mac OS X (10.4.5)  

    Have you tried using WGM to change their login shell to "none"?

  • Solris 11: How to connect to Linux boxes using SSH2-RSA SSH authentication

    Hello,
    I recently installed Solaris 11 11/11 on a cloud-based virtual machine - so that I can start learning about it - and wanted to know what do I need to configure in order to connect via SSH from my SunOS console to some Linux boxes that use SSH2-RSA key authentication.
    Thank you!
    R.
    Edited by: user1113117 on Oct 14, 2012 11:57 AM
    Edited by: user1113117 on Oct 16, 2012 12:34 AM

    Shouldn't have to do anything. What exactly isn't working?

  • Cannot start NodeManager Remotly (Via SSH Commands)

    Hi all,
    we are going to start the node manager of one of the cluster servers via SSH command.
    But it is not starting. We can start it directly by log in to that server and run startNodemanager.sh script.
    What is the issue?
    Thanks,
    Nir

    Hi are you able to start Node manager using following WLST Command :
    startNodeManager(verbos='true',NodeManagerHome='$WL_HOME/common/nodemanager',ListenPort='<PortNo>',ListenAddress='<HostName')
    And also can check NodeManager Log files for errors .
    Regards
    Edited by: TheKop88 on Jun 5, 2013 6:13 PM

  • The letter "G" shows up in the start when I log in to my HTPC via SSH

    When I log in to my HTPC via SSH the letter "G" shows up in the beginning:
    [ Neytiri ~ ]> ssh hund@<IP> -p <port>
    Last login: Fri May 14 08:54:06 2010 from [...]
    G[hund@Fjuppen ~]$
    I dont have this problem when I log in to my server via SSH. I'm using zsh on my workstation and bash on my HTPC and server. If I use bash on my workstation and log in to my HTPC the problem doesnt occur.
    It doesnt causes any problems, but it's disturbing that it's there and that I cant solve it myself.

    I am not sure what the problem is, but I might know where you can start searching for it.
    I have had a similar problem but it was when I tried to convert the official init scripts to C. I got a G at the beginning and It didn't seem like the utf8 support worked for the console (å,ä, and ö didn't work). The problem that I had was that I couldn't get /etc/profile.d/locale.sh to execute correctly from within the C program, it might be that zsh doesn't execute the locale.sh script correctly. I don't have a solution for the problem since I am still trying to solve it myself.
    Anyway. the script is partly generated from line 372 in rc.sysint (pkg: initscripts 2010.05-3):
    echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033%%G"; fi' >>/etc/profile.d/locale.sh
    The generated /etc/profile.d/locale.sh looks something like this (it may of course look different but that depends on the utf8 and locale settings in your rc.conf):
    export LANG=sv_SE.utf8
    if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033%%G"; fi

  • Need to transfer files using sftp via java api's.

    Hi,
    I got a requirement to transfer files using sftp via java api's.
    Kindly specify any 3rd party Java Libraray to do this.
    The requirements are
    -It must support extensive encryption algorithms.
    -It must allow generating public/private keys and authenticating with server by sending the keys first(before the actual file transmission).
    Thanks.

    Don't resurrect old threads, please. Start your own thread.
    Better yet: google for "Java SFTP", look at what you find and come back when you have a specific question.
    And: when you ask a specific question, then clarify if you're talking about the [SSH file transfer protocol|http://en.wikipedia.org/wiki/SSH_file_transfer_protocol] or about FTPS, which is sometimes (wrongly) called SFTP.

  • [SOLVED] Play music via SSH

    I cannot imagine this is that hard of a problem, but I apparently cannot find the right combination of words to get what I need out of google or the forum search.
    So I have a mac mini that I have an external hard drive connected to.  This external hard drive holds my music collection.  I connect to the mini via SSH.  I just need a music player on my arch laptop that lets me play my music over the ssh connection.
    Thanks in advance.
    Last edited by flowheat (2009-02-16 00:36:44)

    Additional suggestions are;
    using edna: http://edna.sourceforge.net/
    using a network sound server: http://wiki.squeak.org/squeak/1676
    Piping both trough SSH is a technicality (lookup ssh forwarding or ssh vpn's). If that is really what must be done?
    Why would an additional open port be a problem? That's what you will get anyway with VLC, Icecast, mpd, edna... if it's filtered and you must go trough SSH then you also have your anwser. My personal suggestion is edna btw, great little script.
    Last edited by anrxc (2009-02-16 02:50:26)

  • Neighbors Mac mini (10.3.9) was exploited via SSH

    My neighbor called me a couple of weeks ago to say she couldn't log in to her mini. It wouldn't accept her password. I fixed it but last weekend the same thing happened again. I fixed it but decided to look around. I found a couple of perl files in her home folder, a few tgz files, and some software for running a shoutcast server. I knew right away someone had gained access to her machine. All because when I set her mini up, I turned Remote connectivity via SSH on. I checked her bash history file and found that someone had downloaded those files using the curl command from some Romanian sites. The files were definitely cracker related, although I don't remember exactly what the names were. I think one of them was spoofer or something like that.
    I'm going to send an email to Apple on this in hopes that they add a security patch to 10.3.9.
    I have since reinstalled OS X and NOT turned on Remote Connectivity.

    Hi Dale,
       Are you saying that you think that Apple enables the finger daemon by default? I don't believe that to be the case. On Tiger, the /System/Library/LaunchDaemons/finger.plist file that ships with the system contains the following line:
    <key>Disabled</key>
    On Panther, the /etc/xinetd.d/finger file that ships with Panther contains the line:
    disable = yes
    Thus, on both systems, the fingerd daemon doesn't respond to finger requests from external systems. I tested that and the only thing that finger returns is the name of the remote system in square brackets.
       Also, the script kiddy attack to which I referred is nowhere near that sophisticated. I haven't actually read the script but the list of users it tries appears to always be the same. I agree with you that it might be possible to gain knowledge about the usernames on many systems, especially those running fingerd. However, excepting for finger and maybe LDAP, the methods for doing that would likely be different for different systems. This script goes for quantity instead of quality so it doesn't spend enough time on any one system to do any probing.
       As Michael says, Mac OS X ships with all services turned off, including fingerd. I don't think that Apple's firewall tool is of any use because it's "all-or-nothing". Opening a port to the world or blocking it is no different from turn the corresponding service on or off. However, I've never seen a GUI tool that did much better so I don't see that as a ding against Apple.
       I've read too many of your extremely knowledgeable posts to think that you rant arbitrarily. Of course people with such excellent reputations are allotted 5 random rants per calendar year here so you're allowed. If you post the details about the problems you're having, perhaps we could help. You should be able to solve almost any issues about services with a solid firewall.
    Gary
    ~~~~
       Am I ranting? I hope so. My ranting gets raves.

  • How to logout remote server via SSH

    I have a server running flux, I just want to log it out (it auto-logs back in, no GDM screen). How do I do this if I'm connected to it via SSH? Again, I want to log out the server as though I would do ctrl+alt+backspace locally, but through SSH.
    TIA

    I just realised how you start your session by auto login, so my above answer was pretty useless. The way I manage my server with an occasional gui session is to just use gdm and start/stop the daemon as needed via ssh then switch to a vnc  or xdmcp session.

Maybe you are looking for

  • Is a text editor really better than Dreamweaver?

    Hi Everyone, I've been looking through several different web design forums and I'm now stuck with a question. Why do some people swear by using only a text editor to put their website together and totally discount programs such as Dreamweaver? I find

  • Since doing the update to iOS 6 my connection isn't staying for facetime or messaging.  And suggestions

    Since updating my iPad 3rd generation to ios 6 I am having trouble connecting with FaceTime and messaging.  Anyone have any suggestions?

  • Pavilion g6 2291sa not booting up

    Hello, I have a Pavilion g6 2291sa that is refusing to boot up. The power light is on, the wireless light is on and the caps lock light turns on and off but there is no sound coming from the hardrive and nothing coming on the screen. I have tried a h

  • Document 60000030482 cannot be reversed due to clearing reset

    Hello Freinds, Has anybody faced this error during FP09. Document 60000030482 cannot be reversed due to clearing reset There are some documents which are stuck in clarification list. Please can anyone help me to rectify this error. Regards, Charvi

  • Unregistered FXS port in CME

    I'm having trouble getting one of my clients' analog endpoints to register in CME.  There are at least another dozen SCCP analog devices configured and they all seem to work fine.  According to the debugs inbound calls are routing appropriately but b