Script to turn on remote login in preferences

I like to make a script that would open port 22 (remote login) in the sharing pane.
I have
do shell script "/usr/bin/open /System/Library/PreferencePanes/SharingPref.prefPane"
this brings up the correct window. But now I am stuck, how do I get the remote login to ‘switch’ on?
Thanking you for suggestions and help.

Solved it.
script is:
do shell script "/usr/bin/open /System/Library/PreferencePanes/SharingPref.prefPane"
activate application "System Preferences"
tell application "System Events"
tell process "System Preferences"
click checkbox 1 of row 4 of table 1 of scroll area 1 of tab group 1 of window "Sharing"
end tell
end tell
But in order for it to work yo need to turn on "ENABLE ASSISTIVE DEVICES" in the "UNIVERSAL ACCESS" preferences pane.
so simple...

Similar Messages

  • Can't Set Remote Login OFF via Send Unix Command systemsetup

    Trying to use the System Setup->Remote Login template in ARD to turn off Remote Login (SSH) in Sharing panel of System Preferences on Mac that is administered through Apple Remote Desktop.
    In Apple Remote Desktop (ARD), I select the client machine, then choose "Send Unix Command..." from the "Manage" menu. In resultant window, I pick "System Setup->Remote Login (SSH) from the "Template" drop down box in the upper right. That populates the upper window with Unix commands. I edit/change the "on" to "off" and tell the dialog to Run command as User: root, then click on "Send" button.
    Progress bar goes forever with no change.
    I can turn off Remote Login via ARD by controlling each client machine via an ARD WINDOW, then navigating to the Sharing Preference pane, but that process is tedious when performing for multiple client Macs.
    Strange, but I CAN use the "Send Unix Command..." outlined above to turn ON Remote Login, and get the status of Remote Login ("systemsetup -getremotelogin"). Just can't turn OFF Remote Login (quickly/efficiently).
    man systemsetup suggests I need to write the command as "setremotelogin -f off" but that failed with an improper command syntax error.
    Thoughts?

    It’s waiting for you to type a confirmation. If you run this command on the command line normally, you’ll see the message:
    Do you really want to turn remote login off? If you do, you will lose this connection and can only turn it back on locally at the server (yes/no)?
    Use this command instead:
    systemsetup -f -setremotelogin off

  • Getting ssh_exchane_identity error when trying to login from my machine or a remote one. Already enabled remote login

    I updated my system from Snow Leopard to Lion 7.3.1
    Wanted to login from remote computer and then enabled the remote login in Preferences/Sharing, but when trying to login I get the error ssh_exchange_identification also if I try to login from my machine with ssh username@localhost.
    I tried all what I could find on internet forums, but nothing changed.
    Please help!!
    Daniela

    Hi Linc
    here is the output of ssh -vvv localhost
    OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
    debug1: Reading configuration data /etc/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to localhost [::1] port 22.
    debug1: Connection established.
    debug3: Not a RSA1 key file /Users/danielamaurizio/.ssh/id_rsa.
    debug2: key_type_from_name: unknown key type '-----BEGIN'
    debug3: key_read: missing keytype
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug3: key_read: missing whitespace
    debug2: key_type_from_name: unknown key type '-----END'
    debug3: key_read: missing keytype
    debug1: identity file /Users/danielamaurizio/.ssh/id_rsa type 1
    debug1: identity file /Users/danielamaurizio/.ssh/id_rsa-cert type -1
    debug1: identity file /Users/danielamaurizio/.ssh/id_dsa type -1
    debug1: identity file /Users/danielamaurizio/.ssh/id_dsa-cert type -1
    ssh_exchange_identification: Connection closed by remote host
    [1]+  Done                    edit sshd_config
    The following line comes from /var/log/secure.log
    May 23 04:59:46 <danielamaurizio> sshd[2267]: fatal: /var/empty must be owned by root and not group or world-writable.
    but I'm not sure if it's want you asked me; the owner of /var/empty is root of group sys.
    By the way I had a problem that Lion cancelled the owner root and I had to use System Preferences User and groups to add root again, with the result that now I can use only the comman "su root" and not "sudo anycommand"  anymore.
    Thanks for halp and cheers
    daniela

  • After Clean Install of Yosemite, Screen Sharing & Remote Login are turned on in Sharing preferences

    Do you guys know if this is a bug?
    I created a custom USB Yosemite installer using the 'createinstallmedia' binary inside the Yosemite installer.
    Booted iMac with this USB installer and proceeded to install Yosemite (fresh formatted drive). No problems.
    When I log in however, and check the Sharing PreferencePane, both Screen Sharing and Remote Login are turned on.
    I've tried this multiple times (repartitioning the drive each time and I have created the installer media twice).
    I'm posting this I guess more as a report as the solution is simple enough (uncheck these services).
    But it's definitely a security risk.

    Just 2 minutes before I received your reply I solved the problem.  I have been running a software firewall (DoorStop X) on the Mac Pro.  It turns out that I had not allowed traffic over two ports necessary for Home Sharing– port 3689 and udp port 5353.  When I corrected this everything is back to normal.
    I did the clean install because I've been having intermittent problems with several apps including Compressor, Safari, and to a lesser extent FCP.  I've been contemplating doing this for several months because of all the garbage that has collected on my system over several years since I last started from scratch.  I have a bad habit of installing things that add kext files and otherwise modify the OS.  I decided to get rid of all that stuff.  I'm glad I did.  All the problems I was having seem to have resolved.  Safari runs 3x faster than it ever has.  And I no longer have the headaches that Compressor was giving me.  I think I'll take better care of my system from now on.
    John

  • Script to open Remote Login in "sharing" not working after move to 10.5

    Under 10.4 I sued the following script to open Remote Login (tick the box). Under 10.5.6 it does not work.
    do shell script "/usr/bin/open /System/Library/PreferencePanes/SharingPref.prefPane"
    activate application "System Preferences"
    tell application "System Events"
    tell process "System Preferences"
    click checkbox 1 of row 6 of table 1 of scroll area 1 of tab group 1 of window "Sharing"
    delay 3
    tell application "System Events"
    quit application "System Preferences"
    end tell
    end tell
    end tell
    I get the following error:
    System Events got an error: Can’t get tab group 1 of window "Sharing" of process "System Preferences". Invalid index.
    Anybody know why?

    give this a spin
    activate application "System Preferences"
    tell application "System Events"
    tell process "System Preferences"
    click button "Sharing" of scroll area 1 of window "System Preferences"
    select scroll area 1 of group 1 of window "Sharing"
    select static text "File Sharing" of row 3 of table 1 of scroll area 1 of group 1 of window "Sharing"
    select checkbox 1 of row 3 of table 1 of scroll area 1 of group 1 of window "Sharing"
    click button "Options…" of splitter group 1 of group 1 of window "Sharing"
    click checkbox "Share files and folders using FTP" of sheet 1 of window "Sharing"
    delay 0.5
    select button 2 of sheet 1 of window "Sharing"
    keystroke return
    delay 0.5
    tell application "System Events"
    quit application "System Preferences"
    end tell
    end tell
    end tell
    -----------------

  • How to you prevent disabling remote login via managed preferences?

    this doesn't seem to be an obvious setting.
    i want to disable our users from disabling remote login on their machines. some of them know how to do this.
    everyone has moblie home accounts, btw.
    hope someone can help!
    thanks in advance.

    thanks for your response, Tony.
    your 2nd suggestion is more towards what i am looking to do.
    we have WGM with User, Computer, Groups, and Computer Groups. right now, we aren't managing any preferences and we do make the users local admins on their machines after their first login/Home Sync.
    i was hoping to add a manifest to WGM in Preferences/Details, but i am not sure if this is possible and if it is, i don't know how to do it.
    we have users in remote sites that connect to our network via vpn and sometimes i need to remotely access their machines. but i can't on those that turn it off, obviously.
    thanks again!

  • Script to enable remote login

    In my job I am constantly required to SSH into other computers to fix problems via terminal. Is there any known script that I can use to enable remote login on my computer quickly rather than having to go to system preferences every time?
    Thanks for your help!

    I'm not sure I understand this request.
    In my job I am constantly required to SSH into other computers to fix problems via terminal.
    OK, fair enough...
    Is there any known script that I can use to enable remote login on my computer
    Enabling SSH/remote login on your computer isn't going to help at all. You need to enable remote login on the remote computer.
    It may be possible to have an AppleScript execute commands on a remote machine, if that's what you mean, but in order for this to happen the remote machine has to have Remote Apple Events enabled. In my experience, there are even fewer machines with Remote Apple Events enabled than there are with Remote Login - it's disabled by default and is unlikely to be enabled by most users.
    So if Remote Login isn't enabled, your only solution is Remote Apple Events, but if that's off you're pretty much out of luck (unless you have some kind of screen sharing setup running).

  • System preferences remote login address naming HELP PLEASE

    Hello,
    This problem is driving me crazy... Enabling Remote Login (under Sharing Preferences) gives me a note that "To log in to this computer remotely, type ssh [email protected]". The problem is the part of the address named "wrongname".  I have no idea where it is picking this up. I've gone back under the networking preferences and confirmed it's not coming from there. The netbios name by the way is "CARLS-MACBKPRO1". Enabling file sharing gives me the same "wrongname". Any idea where this is coming from and how do I fix it?
    Running 10.7.3 on a Macbook Pro.
    Thanks in advance.
    Carl

    The question is how are you trying to connect to the server? and where are you testing from?
    You say you can 'log-in to the Mac-Mini from the internal network', but what protocol are you using?
    The ports you've opened are for web (80), FTP (21) and SSH (22), so if you're using any other protocol (e.g. AFP for file sharing), it won't work.
    So, you need to decide what protocol you want to use and forward the appropriate ports. For example, if you do want to use AFP to transfer files, you'll need to open port 548.
    An alternative is to just use port 22 and use SSH tunneling to tunnel other protocols over a secure connection (normal AFP, web, etc. traffic is not secure and tunneling these protocols over an SSH connection provides an enhanced level of security.

  • Screen Sharing and Remote Login suddenly stopped working

    I have had Screen Sharing and Remote Login turned on on my iMac for several weeks and they have been working fine up until now. I have been accessing the computer via VNC programs and command-line ssh logins from other computers on the same local network. When I tried to connect today, i was given the following error message.
    ssh: connect to host xxx.xxx.xxx.xxx port 22: No route to host
    I have all of the required settings turned on in System preferences and there are no firewalls or router settings blocking it. I connected the two computers together via ethernet cable and the error message still occurred.
    I can ssh from the machine to 127.0.0.1, so the ssh server is running. I can ssh to other locations from the laptop i am attempting to connect with, so that's not the problem either. I just spent an hour on the phone with the apple tech support line and they couldn't figure anything out either. Can anybody figure something out?

    have you tried the obvious - restarting the computers involved and the router?

  • Administrative user can't access other accounts or delete remote login

    I have the administrative user account on my iMac at home. My daughter can't remember the new password I assigned her and needs me to change it. When I log into system preferences/accounts, it shows that I am the administrative user. However, when I try to access her account or the Guest account on the computer they are gray and I can't select them. I can't add any new accounts or delete any existing ones either.
    I also noticed that remote login SSH is turned on. I tried to uncheck that box multiple times but my iMac just freezes. I have to force quit system preferences.
    Any ideas on how I fix this?

    I enabled the root user. While now I can access the elements that were greyed out before, when I attempt to change something my Mac will freeze and just show the color wheel when I attempt to do something with the mouse. If I go up to the menu and pick Force Quit, the list shows System Preferences (the ap has stopped responding). I've shut system preferences with a force quit, rebooted several times and tried again but the same thing happens every time.
    I also can't get it to read a disc so I can't even reboot from my Mac OS system disc to do an archive and reinstall. Does it sound like my system, hardware or both? Is it something that I bundle off my iMac to a Mac Genius to fix?
    If this was a PC, I would swear that I had a virus.

  • Remote login via ssh and public keys

    I'm not exactly a UNIX expert, but I need to be able to remote login to my PowerBook. The problem with enabling ssh is that as soon as I'm on campus, all kinds of nefarious hosts try brute force attempts to crack my password. I've heard that public/private key logins are the answer, and I've managed to get the public key in the right place on my PowerBook (the private key resides on my iPhone, from which I'll be logging in). But I have two questions:
    1) How do I disable logins via user/password?
    2) When I use my private key, I'm asked to enter the password for the key -- ssh isn't properly storing that password. I've checked permissions, but how can I get ssh to store that password, as it should?

    1) In Sharing > Remote Login, do I still need an account listed to be able to use ssh logins with a public key? I ask because currently (i.e. password authentication enabled), when no accounts are listed, login via public key doesn't work. In other words, an account has to be listed for public key logins to work.
    Yes you still need an account name to login to that computer. However you don't need to specify an account in the sharing preferences. You can lock down the security further by limiting which user accounts can login via ssh.
    by default if you don't specify a username when you login it will use the username of the device your logging in from. So to use an alternative login name you would use
    ssh [email protected]
    whereas john can be anyname or your choosing.
    Put another way: if turn off password authentication for ssh in sshd_config, how should Sharing > Remote Login be configured?
    If you turn off password authentication you still need to allow your user account to login via ssh in the sharing preferences or you can allow all.
    2) According to that MacOS X Hints article:
    "Leopard has now a built-in support for SSH authentication with public keys.
    OSX has been able to use ssh public key authentication since day 1 of the beta release of osx. It is not new to leopared it has been around for years.
    Just open Terminal and ssh to your public-key-enabled server. A Keychain window appears, proposing you to enter the pass phrase, and then remembering it in your keychain. "
    I have not used this functionality as I don't use any passwords for ssh logins.
    They're talking about the password associated with the key. But on second thought, that password is being saved on the client, not the server, right?
    I am sure this is the case.

  • What is the best way to remotely login to another Mac?

    My mother & I recently decided to take the plunge from the PC world to Apple world.  I have an MBP w/ OS X 10.8.2, and she has the same w/o the recent OS upgrade (10.7.?).  While we're both still at the bottom of the learning curve, I'm a little further ahead and am constantly running over to her place to trouble shoot/assist her with the transition.  I've been researching ways to remotely login to her computer and am now more confused than when I started.  Can anyone point me in the right direction?  I basically want to be able to login to her system and takeover as if I were on site.  And, while I don't know if my research, thus far, has brought me any closer to a solution, it has raised a few questions:
    1)  Do I simply want to go with 3rd party sofware like Logmein and will the free versions be sufficient or are they just trial offers?
    2)  Or is ARD my best option and am I right in assuming we'd each have to pony up the $80 for installs on both MBPs?
    3)  Some of the discussions talk about much more expensive ARD fees with multiple licenses.  Am I correct in assuming these are meant for network administrators and wouldn't be necessary for my purposes?
    4)  I noticed a free VCN version available from the App Store but came accross posts which seem to indicate possible security issues.  Are these valid concerns and does ARD address them?
    5)  Will I run into problems because we're using different OSs?
    6)  I attempted to follow instructions for an "ssh" remote login that I found by doing a search of 'remote login' under the Apple Support.  But when a password was requested, I didn't seem to be able to enter one into the command line.  Again, I'm new to Macs, but the cursor didn't move when I entered characters, so I was left wondering whether characters were being entered or whether this is Appple's '*****' feature used to guard passwords.  Either way, after 3 attempts, my efforts were repeatedly terminated.  Unfortunately, I'm not even sure I was entering a valid password as the article I'm referring to didn't specify how to set a password.  I used a VCN password I had set up under the Remote Management option in the Sharing utility under System Preferences.  I'm assuming this was the password they were looking for but couldn't be 100% sure as the instructions I followed were not related to "ssh" logins nor were they from Apple Suppot.  Anyway, is this "ssh" login worth pursuing and does it function independently or does it only work in conjuction with ARD?  If it is a stand alone solution, where can I go for better guidance?  The Apple Support link I used was:  http://support.apple.com/kb/PH1112.
    7)  Being recovering Windows users, we both have MS Office for Mac 2011 which has MS's Remote Desktop Connection app.  But from reviewing a few posts, it looks like that comes with it's own set of issues.  It also kind of defeats the purpose as I'm trying to wien myself off of MS.  But if someone out there has experience and suggests this as the "ultimate" solution, I'm willing to listen.
    I know I've babbled on quite a bit and I don't actually expect anyone to take the time to answer all of my questions.  But I'm hoping I might get a collective answer, and more importatnly, I'm really hoping to narrow the field and get generally guidance on the best Mac-to-Mac remote login solution.  Thanks in advance for any advice.

    Hi gregory,
    It is a big subject, and the following article sets out various options.
    http://www.macworld.com/article/1152611/remoteaccesintro.html

  • How do you turn off the login password?

    Hi new to the mac how do I turn off the password login? when I go into system pref and into login options everything is grayed out and can't select anything.

    in system preferences->accounts click the lock at the bottom and enter your password. then you'll be able to access login options and turn on automatic login.
    Message was edited by: V.K.

  • Can't download files -even the support center's remote login appl won't download;  web sites like USA Today will not open; etc.

    This all started by certain sites not opening, like USA Today; Intellicast.com.  Installed Maverics yesterday successfully and the web sites very briefly worked and then starting failing again.  Called tech support and couldn't download their remote login code.  From Safari's viewpoint thought there might be a problem with Adobe Flash.  So deleted that and then tried to download the installer code from Adobe and that wouldn't download.  Suggestions would be appreciated.

    Firefox can find plugins in several locations, but Firefox 21 changed the location of the "shared" plugin folder so older installers like the Microsoft Windows Media Plugin no longer drop the DLL file in the correct location.
    There apparently are two ways to address this:
    (1) Change a Firefox preference so that Firefox checks the old location. Here's how:
    (i) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (ii) In the filter box, type or paste '''plugins''' and pause while the list is filtered
    (iii) Double-click '''plugins.load_appdir_plugins''' to switch its value from false to true.
    This will take effect after you restart Firefox.
    (2) Copy the plugins folder to the new location. Here's how on Win 7 64-bit:
    Open a Windows Explorer window to:
    C:\Program Files (x86)\Mozilla Firefox
    Right-click and copy the '''Plugins''' folder
    Double-click the '''browser''' folder to open it
    Right-click and paste
    Right-click the new copy of '''Plugins''' and rename it to '''plugins'''
    After restarting Firefox, the plugins in that folder should now be available.
    ''Edit: I suggest just doing #1.''

  • Question on Remote login

    I was on my work computer, went to "sharing" clicked on "remote login". I received the information to type in to login to that computer. I then had my husband turn on my home computer & do the same.
    Question #1 - Now that I have the information to type so I can login, where do you go to actually login & enter that information provided?
    Question #2 - My work computer has an IP address that I have to type in if I want to login to my work computer. But the information I'd have to type in to login to my home computer does not have an IP address in the information provided. Is that weird?

    You "could" run the login gadget remotely. But why? Let me explain, you could have a complete portal installation on a gadget server (due to API calls). The gadget could run over there. I'm not sure if the overall performance of that architecture is really worth it. Am I missing something? I have done that before... I really don't know how well it scaled or performed (the customer was very small in terms of servers and users).

Maybe you are looking for