Using DB to run command locally.

Is there a way toolset to run a local command on db.
I currently use a host command via our software to copy some files from one area of the db server to another. But would rather this be done via the database.
ITs a simple run command
CMD /c MOVE /Y c:\install\*.* c:\

http://lmgtfy.com/?q=oracle+pl%2Fsql+os+command

Similar Messages

  • Use SMA to run commands inside VM created from WAP

    Hello,
    I didnt find any SMA specific forum, so I post here.
    Im new to SMA and have a question that I cant find the answer to.
    We are about to deploy a new Hyper-V/SC/WAP enviroment.
    We use virtual networks and I have problem to connect and execute powershell on the virtual machines.
    I want to do some cutomizations on the VM after they are deployed (Windows Server 2012R2) from a Gallery item in WAP.
    In VM Clouds in Service Management Portal I have activated an Automation with Object = MicrosoftCompute VMRole and Action = Create.
    In my Runbook I check the status on the creation of the VM and when the status is complete I want to execute some powershell on the new server.
    So far so good, but here is my problem, I cant connect to the new VM.
    I have tried:
    $ComputerName = $ResourceObject.ComputerName
    InlineScript {
    Get-Service | Out-File “c:\test.txt”
    } -PSComputerName $ComputerName
    I have tired to add -PSCredential after -PSComputername aswell.
    The Runbook will enter a Suspended state with the following exception:
    Connecting to remote server Fredrik-Test failed with the following error message : WinRM cannot process the request. The following error occured while using Kerberos authentication: Cannot find the computer Fredrik-Test.
    It looks like SMA have no clue how to access the new VM.
    I went to the VMM server and ran the following script:
    $adminpasswd = ConvertTo-SecureString “xxxxx” -AsPlainText -Force
    $adminCredentials = New-Object System.Management.Automation.PSCredential (“administrator”, $adminpasswd)
    $VM = Get-SCVirtualMachine | Where-Object {$_.Name -eq ‘Computer013′}
    Invoke-Command -Computername $VM.ComputerName -ScriptBlock {Get-Service | Out-File “c:\test.txt”} -credential $adminCredentials
    And there I got same error:
    [Computer013] Connecting to remote server Computer013 failed with the following error message : The WinRM client cannot process the request because the server name canno
    t be resolved. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (Computer013:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : ComputerNotFound,PSSessionStateBroken
    How do I run commands inside the VM that is created from WAP in a Tenant cloud and use virtual network ?
    Regards
    Fredrik Ljus

    I get same error.
    Because I use Network Virtualization it looks like SMA or VMM cant find the VM.
    But how does it work if you for example make a gallery item that will install SQL.
    In that case the server will be installed from the original image with only the OS and then the SQL server will be installed after.
    How does the VMM/SPF communicate with the VM to install the SQL server? Bacause when installing the SQL server it mounts a VHD with the media and trigger the install localy on the VM.
    So, somehow it must be possible to communicate with the VM without using NAT and go through the Gateway server?

  • Using java to run command line as %username%

    Hi all,
    can any one help with this?
    I'm trying to run a command line from a database as %username% in Windows. So far I have the following script, courtesy of Frank Naude to build a java class that is published within a plsql procedure. A command line can then be passed to it.
    rem -----------------------------------------------------------------------
    rem Filename: oscmd.sql
    rem Purpose: Execute operating system commands from PL/SQL
    rem Notes: Specify full paths to commands, for example,
    rem specify /usr/bin/ps instead of ps.
    rem Date: 09-Apr-2005
    rem Author: Frank Naude, Oracle FAQ
    rem -----------------------------------------------------------------------
    rem -----------------------------------------------------------------------
    rem Grant Java Access to user USER1
    rem -----------------------------------------------------------------------
    conn sys/password@database as sysdba
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.io.FilePermission', '/bin/sh', 'execute');
    EXEC dbms_java.grant_permission( 'USER1', 'SYS:java.io.FilePermission','C:\WINDOWS\system32\cmd.exe', 'execute' );
    rem -----------------------------------------------------------------------
    rem Create Java class to execute OS commands...
    rem -----------------------------------------------------------------------
    conn user1/password@database
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\WINDOWS\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    // Execute the command...
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    // Capture output from STDOUT...
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("stdout: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    } catch (IOException ioe) {
    System.out.println("Error printing process output.");
    ioe.printStackTrace();
    } finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    // Capture output from STDERR...
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("stderr: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    } catch (IOException ioe) {
    System.out.println("Error printing execution errors.");
    ioe.printStackTrace();
    } finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    show errors
    rem -----------------------------------------------------------------------
    rem Publish the Java call to PL/SQL...
    rem -----------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE host(p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    show errors
    rem -----------------------------------------------------------------------
    rem Let's test it
    rem -----------------------------------------------------------------------
    exec host('notepad');
    The trouble is although this script works great for commands that can be run is the 'background' as SYSTEM is I want to pass a command to actually open something e.g. notepad in the above example nothing seems to happen. As far as I can make out the command line is running but not as %username% so it's not running notepad.exe in the foreground.
    I'm happy to clarify more if necessary.
    Can anyone help with this?
    Cheers
    Yog

    Bill,
    Thank you for the quick answer. I believe you are right in your assumption.
    I have been searching but found nothing so far.
    I need to be able to run this line "wmic
    Product where name='XXX XXX XXX' call uninstall" 
    in an elevated command prompt to uninstall the program.
    I was looking for a VB script or PowerShell to execute it remotely on non domain roaming PCs.
    Th3e command can be run remotely against stand-alone workstations but you must supply credentials.  Post in the platform forum for you version of Windows for help in using the WMIC utility.  WMIC /? will give you all of the command options fro
    remote execution.  UAC only affects local systems.  You cannot use WMIC to remote back to the local system. WMIC does not allow impersonation to the local system.
    Most installers will not automatically allow an unattended uninstall.  If there is any dialog at all the uninstall will fail and can hang.
    I recommend contacting the vendor of the application to get more information.
    In all cases you cannot bypass UAC as Bill has noted.  I am only noting that, sometimes, in a workgroup, you can use WMIC to remotely uninstall an application.
    ¯\_(ツ)_/¯

  • Run command without using ./

    Hi,
    Maybe I place this question in a wrong forum. But I guess there is somebody who knows.
    How to run command under Linus platform without using ./ ?
    For instance, I run ./crs_stat.
    How can I run crs_stat ?

    Hi,
    Thanks all.
    The values of the export,
    [oracle@css-rac1 ~]$ echo $ORA_CRS_HOME
    /u01/app/crs/product/11.1.0/crs
    [oracle@css-rac1 ~]$ echo $PATH
    /u01/app/crs/product/11.1.0/crs/bin:/u01/app/oracle/product/11.1.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin

  • Rc.local, run command as regular user?

    I want to run a command at startup that can't safely be run as root (and I don't want it to be anyway).  The only way I know of to execute a command at startup is rc.local, but that will run the command as root.  I know sudo can be used to run commands as other users.  If I use sudo to change what user the startup command is running as, will that be safe?  In other words, will that effectively make it as if it was being run by a regular user instead of root?  Or is there a better way of doing this?  Thanks.

    You can also put it in your .bashrc, so it will be executed every time you log in. For example, I have it set to mount my external disc if it's plugged but not mounted:
    if [[ -r /dev/disk/by-label/disco-externo && `mount | grep disco-externo | wc -l` -eq 0 ]]
    then
    sudo mount /dev/disk/by-label/disco-externo /mnt/disco-externo
    fi
    If you put the sudo away you can start any command as a regular user under certain circumstances.

  • Using computer variables in task sequence "Run Command Line"

    I am attempting to deploy VMs through VMware's vRealize Automation tool using CM. The process creates a CM computer object then creates a direct rule on a CM collection for the new computer object. During the creation of the computer object vRA creates computer
    variables provided by me on the computer object. I see the computer object built and i see the custom variables on the computer object:
    Name Value
    dns1 10.10.10.10
    dns2 10.10.10.11
    gateway 10.10.10.1
    ipAddress 10.10.10.2
    netMask 255.255.255.0
    In the task sequence the last step is to "Run Command Line":
    cmd /c netsh int ip set address name="Ethernet0" static %ipAddress% %netMask% %gateway% & cmd /c netsh int ip set dns name="Ethernet0" static %dns1% & cmd /c netsh int ip set dns name="Ethernet0" static %dns2% index=2
    When the TS gets to that step it doesn't substitute the variables in the command with the computer variables listed above. Looking at the smsts logs after the deployment is complete I see lines stating:
    Set Command Line:...
    Start executing command line:...
    Executing command line:...
    ProgramName = ...
    All of those lines show the command exactly as it is above with the %variables% intact.
    The command immediately fails with the error:
    Invalid address parameter (%ipAddress%). It should be a valid IPv4 address.
    Does anyone have a suggestion on why the TS isn't using the variables? I found this article https://technet.microsoft.com/en-us/library/bb693541.aspx but its for 2007 not 2012. I wasn't able to find something comparable for 2012.

    I don't know why anyone here thinks you *need* sccm osd to achieve fully automated customizations.
    Customer selects base image (2008 r2 core, 2008r2 gui, 2012 r2 core, 2012 r2 gui), which should be thin and with zero customizations anyway,
    vaai accelerated clone creates vm,
    ip addr/gateway/dns config is injected with powercli,
    customers config management engine agent of choice is installed via powercli script injection/execution (we have puppet users, ConfigMgr users, saltstack users, IEM users, Cheff users),
    the clone completes in ~2 minutes and a VM is presented to the customer in less than 5 minutes 
    Deploying windows VMs via SCCM OSD is not only slow, but requires dev work on the customer side to get things rolling which wastes everyone's cycles including your own

  • How to using sqlplus to connect and run command ?

    Hello,i have a small problem please help me
    I want to use sqlplus to connect and run command
    for example : sqlplus test/test@DB select sysdate from dual ;
    and then it will show data (sysdate) to screen
    what should i do ?
    Thanks

    kenshin19xx wrote:
    Hello,i have a small problem please help me
    I want to use sqlplus to connect and run command
    for example : sqlplus test/test@DB select sysdate from dual ;
    and then it will show data (sysdate) to screen
    what should i do ?
    Thanks
    bcm@bcm-laptop:~$ echo "select sysdate from dual ;" > now.sql
    bcm@bcm-laptop:~$ sqlplus user1/user1 @now
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 14 20:41:33 2011
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SYSDATE
    2011-12-14 20:41:33

  • How to run command on all machine in AD?

    Hi,
    I need to run few commands on different OU's in my Active directory environment, and want to make sure commands did run successfully on all machines. Please guide me for the same.

    Hello,
    Either use a Start-Up script or use Enter-PSSession at Powershell or use
    PSExec. Below links might be helpful. You need WinRM up and running on your clients.
    Use PowerShell to Run WMI Commands on Remote Computers
    PsExec v2.11
    Regards.
    Mahdi Tehrani   |  
      |  
    www.mahditehrani.ir
    Please click on Propose As Answer or
    to mark this post as
    and helpful for other people.
    This posting is provided AS-IS with no warranties, and confers no rights.
    How to query members of 'Local Administrators' group in all computers?

  • Using the 'route print' Command in Windows 7 - Detailed Screen Captures

    The 'route print' Command from an Administrative Command Prompt in Windows 7 provides a variety of useful information.  Let's take a look at the output of a 'route print' Command to examine how the output data is grouped and to understand its logic.
    Let's begin by simply issuing the following command:
    route print
    An Administrative Command Prompt output shows the following the following sections of the Command Output:
    Figure 1 - Issuing the 'route print' Command from an Administrative Command Prompt in Windows 7
     Observing the output of the Command indicates there are 5 Major Sections.  The Sections include:
    Interface List
    IPv4 Route Table
    IPv4 Persistent Routes
    IPv6 Route Table
    IPv6 Persistent Routes
    On this Workstation a single Physical Network Interface is visible and has been assigned a DHCP Address of '10.1.1.36'. 
    The IP Stack for this Workstation is as follows:
    IP Address: 10.1.1.36
    Subnet Mask: 255.255.255.0
    Default Gateway: 10.1.1.1
    DNS Server: 10.1.1.1
    DHCP Server: 10.1.1.1
    DNS Suffix: YYY.YYY.isp-provider.net
    Most of the time our focus is upon the IPv4 Routing Table output.  Here are the sections of the IPv4 Routing Table output for reference.
    Figure 2 - The IPv4 Route Table output listing the 'all networks' route through the Default Gateway.
    The next IPv4 Routing Table entry indicates '10.1.1.36' (the Host Workstation' is a member of the '10.1.1.1/24' Network and would route packets out the '10.1.1.36' Interface.
    Figure 3 - The Workstation Host at '10.1.1.36' is a member of the '10.1.1.0/24' Network Subnet.
     The next IPv4 Routing Table entry indicates '10.1.1.36' may receive a Broadcast from the '10.1.1.0/24' Network (as noted by the Subnet Mask of '255.255.255.255').
    Figure 4 - The Workstation Host at '10.1.1.36' can offer a Broadcast on the '10.1.1.0/24 Network' (as noted by the 255.255.255.255 Subnet Mask).
     Another IPv4 Routing Table entry focused on Broadcast Addresses is the following.  The Host Workstation at '10.1.1.36' may offer Network Broadcasts to the '10.1.1.0/24' Network.
    Figure 5 - The Workstation Host at '10.1.1.36' can receive Network Broadcasts from the '10.1.1.0/24' Network (as noted by the '10.1.1.255' Network Destination).
     The next IPv4 Routing Table entries (3 of them) are focused on the Loopback Network Values of '127.0.0.0/8',  '127.0.0.1/32' and the Loopback Network Address of '127.255.255.255/32' respectively.  These Addresses provide Services to the Local Host (or Loopback Adapter).  The Loopback Network Destination of '127.0.0.0' provides access to the Loopback Network through '127.0.0.1' the Loopback IP Address.  The Loopback IP Address of '127.0.0.1/32' receives Limited Local Broadcast to the Loopback Network while the Loopback IP Address of '127.255.255.255/32' provides Limited Broadcast to the Loopback Network.
    Figure 6 - The Workstation Host at '10.1.1.36' uses 3 Addresses for Services to the 'Local Host'. All 3 Addresses incorporate the '127.x.x.x' format.
     Next the Routing Table includes 2 specific entries for the Multicast Network (224.0.0.0/4) for both the 'Local Host' or Loopback  Address of '127.0.0.1' and the Host IP Address of '10.1.1.36' that are '224.0.0.0/4' .  These are used for Multicast Network functions.
    Figure 7 - The Workstation Host at '10.1.1.36' includes 2 Multicast Addresses (starting with '240.0.0.0') reserved for use through either the Loopback Address '127.0.0.1' or the Host IP Address '10.1.1.36'.
     The last 2 Routing Table entries provides Services through Limited Broadcast Addresses.  The Network Destination of '255.255.255.255/32' are the Limited Broadcast Address Ranges for both the Loopback Adapter '127.0.0.1' and the Host IP Address '10.1.1.36'.
    Figure 8 - The Workstation Host at '10.1.1.36' includes 2 Limited Broadcast IP Address Values to Service both the Loopback Network '127.0.0.1' and the Host IP Network '10.1.1.36'.
    Finally, upon understanding the sections of the Windows 7 Routing Table there are additional functions available when using the 'route' Command.  This Blog entry is focused solely on output from the 'route print' Command.
    Summary: In this Blog entry focused on using the 'route print' Command from an Administrative Command Prompt in Windows 7.  Each of the defined routes for a Workstation running Windows 7 Enterprise were reviewed for reference.
    Lynn Lunik
    Chief Security Architect
    IT Pro Secure Corporation
    and exchangesummit.net
    blog <at> itprosecure.com

    I thought, it is my browser issues of not seeing the images.
    but as seen on the other comments, this not in my browser case.
    Can someone check on this and repost the images if needed?

  • Running commands on VMs remotely

    Hi Everyone
    New to all of this so please bear with me!
    Starting a new project and looking to compare between the use of Hyper V and ESXi.  
    The project is to grab vms regardless of state, turn them on and execute scripts stored on a vm drive. The script execution has to be performed / issued by a user. C# is the main underlying code but we can potentially put in references to use powershell
    scripts / whatever else if we can achieve this using hyper v.
    I know from doing a bit of reading on ESXi that we can do this using a number of ways - vmrun to start, stop and run commands on the actual vm itself. using other vmware libraries and APIs.
    I have read that powershell commands include starting vms, taking snapshots, shutting down vms but I was wondering if we can get into the actual VM remotely / somehow in-order to, for example, run a script which is stored on that VMs C drive.
    Has anyone tried this / is it do-able? -  I have had no luck finding any examples of what we need. 
    Kind Regards,
    Ashley

    I have a few things that I have done historically.
    Really, you have two options.  a WMI (API) call or a WinRM / PowerShell remoting call.
    The difference between the two is 1) security settings and 2) ease of use.
    For WinRM the security needs to be more open then WMI.  But, it is far easier to script as you simply open a remote session and you keep scripting along in the remote shell (the tricky part is pulling values back to the local session).  With WMI
    you always get the values back since you never spawn into another session.
    Below is a WinRM example of using WinRM and returning some value back:
    It executes a WMI command on the remote machine to fin the file I am looking for (as that is faster) and then I read the file with the script.
    # This block of script executes remotely and returns the content of hte CtxSta.config file.>
    $sta = invoke-command -Session $s -ScriptBlock {
    $staArray = get-wmiobject CIM_DataFile -filter 'Extension="config" and FileName="CtxSta"'
    # If IIS Integration is installed there could be multiples, this is the one that CSG is hard coded to use.
    foreach ($e in $staArray) {
    if ($e.Path -match "citrix\\system32") {
    $sta = $e
    get-content -path ([string]$sta.Name)
    # We have returned to local execution.
    foreach ($e in $sta) {
    switch -wildcard ($e) {
    "UID*" {
    $e = $e -replace "UID", ""
    $e = $e -replace "=", ""
    $e = $e -replace " ", ""
    $staId = $e
    $staId
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

  • Oracle EM Grid Control Error: Failed to run command in process

    I am trying to change "Backup Settings". After entering the Host Credentials, when I click the OK button, I receive the following error message.
    Validation Error
    Examine and correct the following errors, then retry the operation:
    Error - Connection to host as user <user> failed.ERROR: Failed to run command in process
    Any Suggestions? Thanks in advance!

    Hi,
    If you are using linux/windows the hostname credentials should be the user who has installed the oracle 10g database software, if Windosw the user you are using need to be member of the ora_dba group and have Local Security privilege 'Log on as a batch job'.
    What you need to do is go to start----> Programs----> admin tools----> Local security policy --->local policies ---> user rights assignments
    In the list to your right, look for 'Log on as a batch job', double click and add the same OS local user you using to access OEM web to the group.
    I hope this will solve your problem.
    Cheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • Runing DOS commands locally

    I am able to run a DOS command locally, but I am not able to run a command from my local machine on a server.
    Here is my code to run the command locally:
    String cmd = "cmd /c ls";
    Process child = Runtime.getRuntime().exec(cmd);
    Can I specify an IP address and run the same command from my local machine on a server?
    Tim

    This is not something you really want to implement because of the horrible security problems involved.
    Either arrange for telnet or better yet ssh access to the server concerned and use it

  • SSH SUDO passwordless to run commands on remote server

    Hi Experts,
    We are running various OS/Network and Database related commands and scripts on Local and Remote Server to perform/compare the results
    As part of this activity, we have bottleneck on running commands/scripts on the remote server as we need to provide password everytime whenever we use SSH command
    Also, we need to run command as ssh sudo su - oracle for security purpose which prompts password two times.
    we would like to automate this process in order to save password securely(temporarily) while running ssh sudo commands/scripts.
    I see, there are various solutions using SSHPASS,EXPECT commands, however we dont have anything available to use within our group.
    We may not be able to use SSHPASS as this component not installed during VM build, so we left with only option to use EXPECT.
    So, Need your help to get any example working script using EXPECT for ssh sudo passwordless connection.
    Appreciate if anybody can share ideas or working scripts
    Thanks in advance

    FWIW, here is a small script that I wrote several years ago that may help you to automate the password less ssh setup with a remote system. I just verified it and changed it to create a RSA key. The script still works and runs fine under Oracle Linux and Mac OS X.
    Simply create a script called "passwordless-ssh" with the content shown below.
    Assign execute privileges: chmod u+x passwordless-ssh
    Then run the script as following:
    ./passwordless-ssh user@target_hostname_or_ip
    The script will create a ssh RSA private and public key, prompt for the remote host password and the copy the pubic key to the remote host. A subsequent ssh login to the remote host should no longer prompt for the password. It is essential however that the scrips runs in an interactive session, which is verified.
    #!/bin/bash
    # Creating SSH public RSA key if non exist and copying it to remote target
    # for passwordless SSH login.
    # Author: Catch 22, Oracle OTN, 28-APR-2015
    # Arguments: $1 (ssh login to remote target)
    ME=passwordless-ssh
    LOGFILE="/tmp/$ME.log"
    f-mode()
    # Check if session is interactive (terminal) or non-interactive (UDEV).
    # Output: 0 = interactive, 1 = non-interactive
       [[ -t 0 || -p /dev/stdin ]] && return 0 || return 1
    f-log()
    # Display messages in interactive mode, or write output to syslog
    # (/var/log/messages) when in non-interactive mode. Write the messages
    # to a logfile if the syslog logger interface command is not available.
    # Input: $1 = text
       if f-mode; then
          echo "$ME: $1"
       elif hash logger; then
          logger "$ME: $1"
       else
          echo "$ME:`date`: [logger] Cannot execute, aborting" >> $LOGFILE
          echo "$ME:`date`: $1" >> $LOGFILE
       fi     
    # Exit and show error if current session is not interactive.
    [ ! f-mode ] && f-log "[session] non-interactive, aborting" && exit 1
    keyfile="$HOME/.ssh/id_rsa"
    [ -z "$1" ] && echo "Missing 'user@target_host' argument. Aborted." && exit 1
    if [ ! -f $keyfile ]; then
       mkdir -p $HOME/.ssh
       ssh-keygen -t rsa -f $keyfile -N ''
    fi
    keycode=`cat $keyfile.pub`
    remote_cmd2="echo "$keycode" >> $remote_ssh_file; chmod 644 $remote_ssh_file;"
    remote_ssh_dir="~/.ssh"
    remote_ssh_file="$remote_ssh_dir/authorized_keys"
    ssh -q $1 "mkdir -p $remote_ssh_dir; chmod 700 $remote_ssh_dir
    echo "$keycode" >> $remote_ssh_file; chmod 644 $remote_ssh_file"
    unset ME LOGFILE keyfile keycode remote_ssh_dir remote_ssh_file
    #END

  • TS-Run Command Line-run as different user

    HI
    I needed to deploy one program which do not like SYSTEM account (do not installs). So I created TaskSequence with
    Run Command line and specified domain user which will be running this command.
    Is my domain users password safe or it will be provided in clear text in my network? Because this user must be Admin on local computer.

    Just to reinforce, the tasks use standard, core Windows APIs to impersonate the account and execute the command -- these APIs never send anything in clear text and if they did, then Windows has much bigger issues. It would actually take
    a huge amount of effort to not securely perform this operation.
    Jason | http://blog.configmgrftw.com

  • [solved] hook to run commands when user logs in? (before bash profile)

    Is there any way to run commands when a user logs in but before the bash profile is sourced?
    For example, I have a user account with a home directory on /tmp. When the user logs in, the home directory might not exist so there will be no .bash_profile to source. I want to run a script to create the directory if necessary and copy some files into it. How can that be done?
    I thought of putting something in /etc/profile or /etc/profile.d/, but I would like to run something before the user's shell and environment become active.
    I can use /etc/rc.local to do what I want, but I would prefer a hook to ensure that everything is set right when the user logs in.
    Any ideas?
    *edit*
    Solution
    In my case, I found that I could write my own shell script and set it as a login shell. In the script, I can configure everything I need before launching the interactive shell, then clean up anything after it exits.
    Last edited by Xyne (2011-12-10 19:34:07)

    Thanks, dammannj. PAM could probably do what I need but I think I have found a simpler solution (see original post).

Maybe you are looking for

  • Blue screen crash constant loop

    Apple has a serious issue that they are not addressing tech support said it was a hardware issue. If it is then ios8 broke millions of iphones. The person that answered my call said he had not heard of this issue. I said google blue screen iphone. He

  • Inserting html into a composition in muse

    Hi, I am trying to insert some html into a composition in Muse.  I would like to have a clickable button trigger, and then a kind of overlay opens up with an interactive calculator inside.  I have the html for the calculator, the problem is no matter

  • Commas not correctly processed when values are passed through the URL!!!!!!

    I think this is a bug. Any information about this will be greatly appreciated. Here's the scenario: There's a single page with 2 regions. The first region contains a simple SQL report. The second region is and HTML region that contains text and date

  • How to edit phone number in iCloud keychain

    how to edit phone number in iCloud keychain

  • Apple TV Home Sharing only detects Macbook Pro but not iPads

    Hello My Apple TV (2nd gen) will only detect my Macbook Pro on Home Sharing. I have two iPads (1st gen and iPad Mini) both updated to the latest iOS but they just wont show up on apple TV home sharing. Any thoughts? The software on all devices is up