UNIX command - turning on "windows sharing"

Does anyone know how to activate windows sharing via UNIX command?

sudo launchctl load /System/Library/LaunchDaemons/nmbd.plist
sudo launchctl load /System/Library/LaunchDaemons/smbd.plist
You will also need to configure the firewall to allow windows sharing.

Similar Messages

  • Calling unix command in Apex Window

    I am working on a small project where in; it would be handy to run an external plsql in oracle database which calls for unix command such as tail -f alert.log or tail -1000 alert.log when a button is pressed in the application.
    I know the client and server aspect and very difficult to forward the server output to Application specially web based but still thought of trying my luck to get some insights from this forum .
    Is this possible in Apex ?
    UK

    Don't see why not. All the building blocks are there (assuming a recent version of the database, and that 1000 is a realistic metric of the data volume):
    1. A script to run the required UN*X commands.
    2. An initial log extract file created manually using the script.
    3. An external table on the log extract file.
    4. An external scheduler job to rerun the log extract script to refresh the log extract.
    5. An APEX page with a report based on the external table, and a button that calls the external job.
    Note that providing relevant information when asking a question is helpful in determining a solution:
    - APEX version
    - DB version and edition
    - Web server architecture (EPG, OHS or APEX listener)
    - Browser(s) used
    - Theme used
    - Templates used

  • Windows Sharing and resource fork problems

    Hello, I am into my second month of Mac ownership and today I tried to enable Windows Sharing to allow a PC here to map to the Mac and share files.
    I enabled the Windows Sharing feature in the System Preferences. Then I tried to map to the mac using the PC (Win XP). The PC sat there for a while (maybe about 30 secs or so) trying to connect, then displayed an error message saying a semaphore timed out (I don't remember it exactly).
    Anyway, I went back into System Preferences and all the options for Sharing were greyed out. I couldn't turn off or turn on anything!!
    So I looked in the console log and found the following errors:
    2006-08-30 18:12:40.119 System Preferences[15066] [NOTE: this exception originated in the server.]
    couldn't fork
    /sbin/service: fork: Resource temporarily unavailable
    2006-08-30 18:12:43.336 System Preferences[15066] [NOTE: this exception originated in the server.]
    couldn't fork
    /sbin/service: fork: Resource temporarily unavailable
    2006-08-30 18:12:52.009 System Preferences[20541] hardwareCheckThread got an exception name:NSInternalInconsistencyException reason:couldn't fork
    Aug 30 18:13:37 localhost launchd: org.samba.smbd: fork() failed, will try again in one second: Resource temporarily unavailable
    2006-08-30 18:16:53.360 System Preferences[21610] hardwareCheckThread got an exception name:NSInternalInconsistencyException reason:couldn't fork
    2006-08-30 18:19:13.214 System Preferences[21611] hardwareCheckThread got an exception name:NSInternalInconsistencyException reason:couldn't fork
    2006-08-30 18:31:48.547 System Preferences[21636] hardwareCheckThread got an exception name:NSInternalInconsistencyException reason:couldn't fork
    2006-08-30 18:54:23.310 System Preferences[21650] hardwareCheckThread got an exception name:NSInternalInconsistencyException reason:couldn't fork
    In the System log there are a whole bunch of these messages:
    Aug 30 18:11:23 localhost kernel[0]: proc: table is full
    I went into the Terminal and tried to get to a command prompt but it just sat there with a blank screen.
    So I shut a bunch of apps I had open down only keeping Firefox open and I searched online for issues regarding this error - found information telling me I could kill the smbd processes and up the max proc limit.
    After waiting a while (didn't want to reboot - I'm stubborn :-)), reopened Terminal and could see the command prompt. But anything I tried to do regarding killing the smbd processes or even doing a directory listing or a process listing gave the error: fork: resource temporarily unavailable
    So I just waited it out - eventually I was able to kill the smbd processes. After I did that, I went back into System Preferences and was able to work with the Sharing preferences again (I disabled Windows Sharing).
    And after all that, here is my question(s):
    - is this problem going to keep happening when I turn on Windows Sharing and a PC tries to map to the Mac?
    - do I need to up the process limit if I'm going to turn on Windows Sharing?
    - is there a bug/issue I don't know about regarding this and a fix?
    - and last but not least, am I doing something wrong?
    Thank you for your help.

    There were some Macbook/SMB specific problems that suppossedly got fixed with the 10.4.6 update, but I'd try the 10.4.7 Combo Update, as Deltas have more problems.

  • Windows Sharing causing 50% CPU usage

    I have an iMac Core Duo running 10.4.6, and a few weeks ago the Activity Monitor started showing both CPUs running at about 50% all the time. About 40% of the graph is green (User mode) and 10% is red (System mode) on both CPUs. In addition, there seems to be a constant 275 KB/sec of data written to the hard disk.
    Mysteriously, the Activity Monitor doesn't show any particular process being responsible for the activity, even when I show All Processes. However, after some trial and error I was able to determine that turning off Windows Sharing would make the activity go away.
    I don't need Windows Sharing often, but it is occasionally helpful and I'd like to keep it turned on. Does anyone have suggestions on what I might do to get it working normally again?
    --Stuart
    iMac Core Duo   Mac OS X (10.4.6)  

    Yes, I was getting the same respawning of the nmbd process. I just checked /var/log/samba and see that it is indeed huge: 5 GB It just seems to be repeating the same error over and over:
    [2006/05/30 06:54:32, 0] /SourceCache/samba/samba-92.15/samba/source/nmbd/nmbd.c:main(668)
    Netbios nameserver version 3.0.10 started.
    Copyright Andrew Tridgell and the Samba Team 1994-2004
    [2006/05/30 06:54:32, 0] /SourceCache/samba/samba-92.15/samba/source/nmbd/nmbd.c:main(687)
    standard input is not a socket, assuming -D option
    [2006/05/30 06:54:32, 0] /SourceCache/samba/samba-92.15/samba/source/lib/utilsock.c:open_socketin(724)
    bind failed on port 137 socket_addr = 0.0.0.0.
    Error = Address already in use
    Doing a google search for the error revealed this discussion on Ars Technica, where folks seem to think this problem is caused by installing Xcode 2.3 on an Intel Mac. That would match my situation. Does it match yours?
    http://episteme.arstechnica.com/eve/forums/a/tpc/f/8300945231/m/267005829731
    Someone there posted a technique for disabling just certain background daemons, rather than disabling Windows Sharing entirely. Personally, I'm more comfortable disabling Windows Sharing than fiddling around at a lower level. I've found that if I disable and then re-enable Windows Sharing, everything is OK until I reboot. That will work fine for me until Apple has a chance to fix Xcode.
    I'm going to post a developer bug report about the problem, and suggest you do the same.
    --Stuart

  • How to disable Windows Sharing -- for real

    To move files between my Mac and PC I used Windows Sharing on my MacBook Pro. It works like a charm.
    To enable I go to System Preferences >> Sharing, check the "Windows Sharing" box, press the "Start" button, and enable Windows Sharing for my OS X user account.
    I can then just type my Mac's IP into Windows Explorer on my XP box and voila, full access to my Mac home directory (after typing in my username and password, of course).
    When I'm done I disable WS by performing the activation steps in reverse, and OS X happily says "Windows Sharing Off." However, I find that even though it's off I can still access my Mac from XP. In fact, I'm not even prompted for my password again.
    How do I really turn off Windows Sharing in 10.4.8? Neither my XP box nor my Mac get restarted often, so if my XP box (the weaker link) was compromised, I don't like knowing that my Mac could be reached so easily with full control.
    Any help appreciated. Thanks.

    Strange, but I'd start of by verifying Permissions with Disk Utility, and if that didn't work I'd try Trashing...
    /Library/Preferences/com.apple.sharing.firewall.plist
    /Users/nnnnLibrary/Preferences/com.apple.internetconnect.plist
    /Library/Preferences/SystemConfiguration/preferences.plist
    Reboot and set everything up again.
    And/Or, get Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, boot holding down CMD+s, then when the prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.

  • A HUGE flaw in Windows sharing??

    I have my G4 PowerBook and my wife's Windows XP laptop sharing an AirPort connection to the outside world. I noticed that I could mount the shared documents folder on her computer via SMB/CIFS. I turned on windows sharing on my computer (via the sharing preferences) to see if she could see the Shared folder in /Users.
    Not only could she see the shared folder, but she could see into my home directory and ALL of its subfolders without even password authenticating. She mounted my machine as a network drive (\\10.0.1.3\colin) and off she went. That address is the one given in the sharing preferences pane as the one a windows user should connect to. She was also able to connect to her own home directory, but not to the higher level directory that would allow her to see /Users/Shared.
    In my sharing preferences I also have Remote Login enabled and I changed sshd_config to set 'X11Forwarding yes' in an attempt to get a remote X-server connection working through a VPN to my work.
    But why, why, why, was a windows user able to gain access to EVERY folder on my computer simply by mounting it as a network drive without any password authentication????? Obviously, I have turned off Windows Sharing until I can figure this out.
    Thanks for any input you can give!

    This has always seemed to me to be the mac's flaw that "Windows Sharing" enables all this freedom.
    Go get Sharepoints at http://www.hornware.com
    Install it on mac.
    Configure the folders you want to share with wife.
    Sharepoints manages the SMB.conf file a little better than the generic/vanilla settings that Mac uses with sharing preferences.
    Don't know anything about the X-Server/VPN business you describe.

  • Windows Sharing behind a router

    I often want to send single files to my brother in another city, and I figured that Windows Sharing should let me do this.
    However, when I turn on Windows Sharing, it says "Windows users can access your computer at \\192.168.0.103\Name" which is the IP Address behind my router...
    How do I get around this?
    Matthew

    Since you are only sending 'single files,' if the files are under 2mb, and you are both on DSL or cable, e-mail them.

  • Windows Sharing button "dead"!

    Apologies if this has been answered, but the Search function is presently turned off in the forums ...
    About to upgrade to 10.4.10 and intending to use the "Combo" because some flaky things have been happening lately (lost permissions, oodles of red crosses on folders, Dashboard will only hiccup-not open).
    Problem: When I attempt to turn on Windows Sharing, the radio button recognizes the mouse-click event (I see a very subtle icon change), but it will not activate. Firewall on or off, no difference. And, no filesharing. Boo!
    Any suggestions? Condisering an Archive and install, followed by upgrade to 10.4.10.
    TIA,
    KAS
    Home LAN (Linksys wired and wireless) with 2-3 other Windows XP machines)
    Powerbook G4 (1.0GHz PPC/768M RAM/80G HDD/Combo Drive)   Mac OS X (10.4.9)   Dell Dimension (P4@2GHz/768M RAM/120G HDD/Windows XP)

    Great that Applejack helped... can't fix something
    else with Volume issues!
    Might try trashing...
    /Users/nnnn/Library/Preferences/com.apple.internetconn
    ect.plist
    /Library/Preferences/SystemConfiguration/preferences.p
    list
    /Library/Preferences/SystemConfiguration/com.apple.air
    port.preferences.plist
    /Library/Preferences/SystemConfiguration/NetworkInterf
    aces.plist
    /Library/Preferences/com.apple.sharing.firewall.plist
    /Library/Preferences/com.apple.networkConfig.plist
    Reboot... of course you dont have to trash them, you
    can just move them to the desktop to drag back if it
    doesn't work.
    See if Sharing Panel Works then.
    <snipped>
    BDAqua-
    Moved the preferences files to a desktop folder, rebooted, and found that OS X had "made some changes" for me: First, I had a new user account, using my previous long user name, I was prompted to select a short name & password for the account. I was confused. But since my prior user account had been plagued with problems, I accepted the invitation, took the data I needed from the "dead account," and trashed it. At the same time I chose to upgrade to 10.4.10, using the install I had downloaded from apple.com about two weeks ago.
    Net result: System in general seems cleaner -- which is both good and bad: I have to re-enter much info, but sense that I have lost some gremlins in the process.
    As far as Windows Sharing? Nope! Whatever was renewed by all of the above, I cannot invoke windows sharing.
    If I am correct, and Samba lies at the root of this and my printing problem (i.e., my inability to print to a LaserJet 5P on LPT1: of my Dell/Windows box), nothing we've tried has touched Samba or corrected either issue.
    I can make do without Windows Sharing -- temporarily: I can use Kenbushi (formerly PC-Mac-FileShare) to transfer files plus I just got an external USB/FW400 hard drive (320GB WD My Book) on which I have finally created (after 3 days work) an NTFS read-write partition for the Mac (I deserve another degree for the research I did to solve that little ditty! Both help.
    But since I also still can't print over my network, I STILL need advice. BTW, anyone else can feel free to help!!
    Be well, BDAqua!
    TIA,
    Ken S

  • Unix command for turning file sharing off

    Is there a Unix command I can use to turn off file sharing on Leopard ( as well as Tiger ) laptops? I don't mean a command to kill it for the session, I need it off even if the system is restarted. Yes, I can do it though the Preferences, but I need to do it to over 200 some laptops. We have ARD and if we had a Unix command to send to turn file sharing off that would be helpful. Thank you.

    There is a CLI for just about everything. From the [OS X Leopard Security Configuration Guide|http://images.apple.com/server/macosx/docs/LeopardSecurity_Config20080530.pdf]:
    To disable FTP.
    launctl unload -w /System/Library/LaunchDaemons/ftp.plist
    To disable SMB.
    defaults delete /Library/Preferences/SystemConfiguration/com.apple.smb.server EnabledServices
    launctl unload -w /System/Library/LaunchDaemons/nmbd.plist
    launctl unload -w /System/Library/LaunchDaemons/smbd.plist
    To disable AFP.
    launctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist

  • Unix command to turn "off" caps lock or turn it "on" on lab machines

    Hi,
    I'd like to be able to send a unix command to a lab of panther eMacs. I'm using Apple Remote Desktop 3.2 I would like to send both "turn on cap locks" to all the machines, or "turn off cap locks to all the machines.
    Many of my "Send Unix Command" are applescripts (osascript....) so either a unix command or applescript command would be welcome.
    Thanks!

    Well, I've been busy trying some things and found a beautiful little applescript that will turn off caps lock on 10.4 machines and newer. I'll paste it in below. Here's the problem...
    I can't seem to get it to run in ARD as a unix command. (I put the osascript as first line when I pasted it in... This usually works for sending applescript commands)
    So, any ideas on how to get it to run as a unix command??
    IS THERE ANYWAY TO GET THIS TO WORK ON PANTHER MACHINES?? (they don't have the "modify keys..." button in the keyboards and mice pane of sys prefs). The bulk of our machines (over 300 are eMacs running panther).
    *** script ******
    tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.keyboard"
    end tell
    tell application "System Events"
    tell application process "System Preferences"
    get properties
    click button "Modifier Keys…" of tab group 1 of window "Keyboard & Mouse"
    tell sheet 1 of window "Keyboard & Mouse"
    click pop up button 1
    click menu item "No Action" of menu 1 of pop up button 1
    delay 3
    click button "OK"
    end tell
    end tell
    end tell
    tell application "System Preferences" to quit

  • My Windows XP and Windows 7 iTunes no longer 'see' my AppleTV since latest update (25/02/2013). Also, my AppleTV tells me I must turn on Home Sharing which is already turned on.

    My Windows XP and Windows 7 iTunes no longer 'see' my AppleTV since latest update (25/02/2013). Also, my AppleTV tells me I must turn on Home Sharing which is already turned on. I have the little arrow that normally selects my AppleTV in iTunes but AppleTV is no longer listed (only My Computer). Is there an issue with the latest update. This is probably my fault by telling everyone how good AppleTV is and that it just works! Doesn't work any more :-( I have tried all the usual restarting of AppleTV and PCs. I'm having to revert back to the Samsung Blu-ray player's PC sharing :-(

    Restarted router(s) and it works again.

  • I purchased an album from the itunes store on my ipad2 thinking i could retrieve it from my windows pc. I have turned on home sharing and can see my pc library from the ipad but not vice-versa. Is there any way to transfer the album from my ipad library?

    I purchased an album from the itunes store on my Ipad2 thinking i could access it from my windows laptop where I sync my ipod. I turned on Home Sharing and can see my laptop libraries from my ipad but not vice versa. Is there any way to fix this so I can transfer the album to the itunes on my laptop?

    Yes I tried that. I finally turned off all home sharing settings, shut down my desktop and found them in my account settings in the store on the cloud. So at that point I just had it download everything. But I suspect that with the ipad somehow being on, the store was saying I had already received them? Regardless, my trip today whilst running errands, I was rocking out to vintage Police music! Thank you so much for responding.

  • Requesting user input from UNIX command window

    New to this forum, and relatively new to Java......question for you......
    Currently, I am able to request a .txt file from a user in my unix command window by having them type in the following command:
    java Game (nameOfTextFile).txt
    with the following code:
    public class Game {
    public static void main(String[ ] args) {
    try{
    reader = args[0];
    catch(Exception g){
    System.out.println(g);
    where 'reader' holds the .txt file.
    What I would like to do is as soon as the user types in the command:
    java Game
    it gives them the line:
    "Please type the file to be input"
    and at this point they type in:
    (nameOfTextFile).txt
    and then I can start working with the text file.
    Any ideas?
    Thanks

    public class Game {
    public static void main(String[ ] args) {
    try{
    reader = args[0];
    catch(Exception g){
    System.out.println(g);
    }This class will not compile. The variable 'reader' is not declared anywhere.
    You could create a shell program. When the user enters the name of the shell program at the command prompt, it gives them the prompt to enter the file to be input. And then from within the shell program you call the java program with the name of the file.

  • Unix command to click button on dialog box and close windows?

    I administer an elementary school computer lab of 35 eMacs all with OS 10.4.7 and with ARD 3.0. Our network server configuration requires a mounted server on each desktop in order to administer certain software packages we use. Every morning at start-up I have to walk around and manually click "Connect" on the dialog boxes. Then, with this configuration, each time a server is mounted, it opens up a Finder Window on the host machine so I've got to walk around and close windows on all the machines. I'm sure there must be an AppleScript or Unix command that I can set up to do these two tasks but I've not found it (or learned how to write it) in a few days of searching. Any suggestions?
    Thanks,
    Dan

    OK guys,
    I just succeeded in saving the AppleScript command as an application. I put it in the Login Items just after the servers. It worked beautifully! No more open windows exposing sensitive files to the risks of elementary students (how come the mounted volumes always appear on the desktop even when the "hide" button is checked?). It would be great if the mounted volumes were not showing at least in a setting like a school computer lab.
    Now, I'm still dealing with the mounting process requiring me to manually click on "Connect" every time. The Student account doesn't even have a password just to make such things easier. Still the process displays this:
    (Oh well, I guess I can't insert a ScreenShot.)
    Here's what it says: Connect to the file server "server name."
    Connect as: Registered User
    Name: "account name"
    √Remember password in keychain
    (and then two buttons) Cancel or Connect
    That's where I'm at right now. My district Tech. Support folks say that there's no way to avoid the dialog box but John seems to do it OK. They also pointed me to an online source (www.bombich.com) that I haven't yet checked out.
    Thanks again,
    Dan

  • Calling an unix command from a java program which runs on windows

    Hello All
    I have an Java Application which is run on windows server (I)
    I have another Sun Server (II)
    I want to call an unix command on server(II) from java application which is on server(I)
    I am using Samba Server in order to share files between Windows Server and Unix Server
    Can I use samba in order to call command
    or is there any way to open an telnet session within java application
    I will be grateful if you give me some suggestion on this issue
    Regards
    BEKIR BALCIK
    J2EE Application Developer
    Argela Technologies ...

    cross post
    http://forum.java.sun.com/thread.jspa?threadID=624601&messageID=3553626#3553626

Maybe you are looking for