Test  ssh -ND connection in a shell script

I use a web proxy with firefox by setting up this ssh tunnel:
ssh -ND 8080 [email protected]
Is there a shell script way (like with nc) I can test this connection?

Hi Bill,
   I don't know if I'll be able to provide all of the help I'd like to because I have to get ready to go out of town. You used Fink to install "wget", right? "wget" will do almost anything a browser will do so I can't think of a better way to test from the command line. If you don't have "wget", "curl" will do. Is that what you had in mind? You can probably do it with "telnet" but "wget" understands complex URLs which, to my taste, is an easier way to specify the port.
Gary
~~~~
   Lizzie Borden took an axe,
   And plunged it deep into the VAX;
   Don't you envy people who
   Do all the things YOU want to do?

Similar Messages

  • How to retrive ip address of connected device in shell script or applescript

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

  • BI Admin Tool - Setting connection pool via shell script - Is it possible?

    Hi,
    Here's the problem I am trying to solve.
    I am using a J2EE application that uses OBIEE for reporting.
    The *.rpd file is installed at a particular location when our J2EE product is installed.
    I then copy the *.rpd file to the BI home on a different server using a shell script.
    The shell script that deploys the *.rpd file does the following:
    1. Shuts down BI processes that are running
    2. Deletes the old *.rpd file
    3. Copies the new *.rpd file
    4. Starts all BI processes
    I am happy with the way we have automated this process, but would like to take it one step further.
    The *.rpd file does not have the connection pool hard-coded in it. And we want to keep it that way.
    What we would like to do is - pass the connection pool parameters to the shell script (that is used for *.rpd's deployment) and have it automatically update the *.rpd file. Is it possible to do this at all? How do we go about accomplishing this?
    Or in other words - Is there a way to update the connection pools WITHOUT hard-coding it in the *.rpd file or WITHOUT using the BI Administration Tool.
    Currently, we manually update the connection pools in the Physical Layer using the Oracle BI Administration Tool.
    The version of BI Administration Tool being used is 10.1.3.3.1 installed on a Microsoft Windows XP Professional SP2 machine. The BI Server itself is running on an Oracle Enterprise Linux 4.0 box.
    Do let me know if you need more information that would help answer this question.
    Thank you.

    Thank you - fiston and Gagan.
    I am going with fiston's solution - since it is easier to implement. I am on the QA team and the automated deployment is to lessen QA's deployment time.
    While one of our developer's said that she prefer's Gagan's solution - it would be over-kill to make changes to the application's schema for the said purpose.
    I will further make another post as to whether or not the automated deployment worked for us.

  • Connect internal in shell script not working

    Oracle: 11.2.0.1 in AIX env
    I export ORACLE_SID and then try to connect internal but I get connected to idle instance. What am I missing???
    this block is in a .sh script
    export ORACLE_SID=ufms203
    $ORACLE_HOME/bin/sqlplus /nolog <<EOF
    connect / as sysdba
    WHENEVER SQLERROR EXIT;
    select instance_name from v$instance;
    OUTPUT *********************
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 29 09:43:05 2011
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    SQL> Connected to an idle instance.
    SQL> SQL> SQL> select instance_name from v
    ERROR at line 1:
    ORA-01034: ORACLE not available
    Process ID: 0
    Session ID: 0 Serial number: 0
    Disconnected

    The instance is started:
    k801ora@jd1su143 in /a0143/d01/scripts : ps -ef | grep ufms203
    k801ora 8794340 1 0 12:32:46 - 0:00 oracleufms203 (LOCAL=NO)
    k801ora 8929434 1 0 09:33:52 - 0:00 ora_w001_ufms203
    k801ora 10248348 1 0 Mar 22 - 2:24 ora_pmon_ufms203
    k801ora 10359024 1 0 Mar 22 - 0:15 ora_gen0_ufms203
    k801ora 10379478 1 0 Mar 22 - 7:50 ora_vktm_ufms203
    k801ora 10399748 1 0 Mar 22 - 0:40 ora_dbw0_ufms203
    k801ora 10408158 1 0 Mar 22 - 1:19 ora_psp0_ufms203
    k801ora 10420478 1 0 Mar 22 - 0:16 ora_mman_ufms203
    k801ora 10428426 1 0 Mar 22 - 0:16 ora_diag_ufms203
    k801ora 10436840 1 0 Mar 22 - 0:17 ora_dbrm_ufms203
    k801ora 10440938 1 0 Mar 22 - 12:00 ora_dia0_ufms203
    k801ora 10445048 1 0 Mar 22 - 2:51 ora_ckpt_ufms203
    k801ora 10449134 1 0 Mar 22 - 0:38 ora_dbw1_ufms203
    k801ora 10453232 1 0 Mar 22 - 0:35 ora_dbw2_ufms203
    k801ora 10457330 1 0 Mar 22 - 0:35 ora_dbw3_ufms203
    k801ora 10461428 1 0 Mar 22 - 0:47 ora_lgwr_ufms203
    k801ora 10465530 1 0 Mar 22 - 0:04 ora_reco_ufms203
    k801ora 10469624 1 0 Mar 22 - 0:55 ora_smon_ufms203
    k801ora 10473726 1 0 Mar 22 - 4:42 ora_mmnl_ufms203
    k801ora 10477820 1 0 Mar 22 - 2:43 ora_mmon_ufms203
    k801ora 10485770 1 0 Mar 22 - 0:08 ora_q002_ufms203
    k801ora 10489864 1 0 Mar 22 - 0:07 ora_qmnc_ufms203
    k801ora 10506270 1 0 Mar 22 - 0:04 ora_q000_ufms203
    k801ora 10530842 1 0 Mar 22 - 0:04 ora_q001_ufms203
    k801ora 10588214 1 0 Mar 22 - 0:19 ora_smco_ufms203
    k801ora 11124888 10510484 2 09:54:04 pts/0 0:00 grep ufms203
    k801ora 11796592 1 0 09:35:19 - 0:00 ora_w000_ufms203
    k801ora 12431386 1 0 09:53:53 - 0:00 ora_w002_ufms203
    k801ora 12484794 1 0 12:32:41 - 0:11 oracleufms203 (LOCAL=NO)
    k801ora 16023576 1 0 12:32:04 - 1:12 oracleufms203 (LOCAL=NO)
    k801ora 16629976 1 0 09:25:21 - 0:00 ora_w005_ufms203

  • Intermittent error while trying to connect oracle through shell script

    Hi All,
    I am getting following error Intermittently while connecting to oracle database.
    ERROR:
    ORA-03113: end-of-file on communication channel
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    Please help.
    Thanks in advance.

    I cannot give this file D:\oracle\ora92\network\trace\cli_3932_1.trc (sorry for that) No problem I understant that you don't want post sensitive information.
    You may contact Oracle Support Services (raise a SR along with generated trace files) for problem resolution.
    TNS-12547: TNS:lost contact
    TNS-00517: Lost contact12547, 00000, "TNS:lost contact"
    // *Cause: Partner has unexpectedly gone away, usually during process
    // startup.
    // *Action: Investigate partner application for abnormal termination. On an
    // Interchange, this can happen if the machine is overloaded.
    00517, 00000, "Lost contact"
    // *Cause: Partner has unexpectedly gone away.
    // *Action: Investigate partner application for abnormal termination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Shell Script Resource-Timeout error

    Hi!!
    I have an issue with the Shell Script Resource, the problem is as follows:
    When I created a user in this resource and appears a error message:
    com.waveset.util.WavesetException: An error occurred adding user 'user01' to resource 'Shell Script'. com.waveset.util.WavesetException: Script failed waiting for "_,)#+(:" in response "" com.waveset.util.WavesetException: Script processor timed out with nothing to read and the following unprocessed text: "".
    I added the timeout property = 300 000 in my shell script is as follows:
    <ResTypeAction restype='Shell Script' timeout='300000'>
    but it doesn't work.
    I had the IDM 8 with the patch 4 but the problem beging when I did upgrade to patch 4 to 6.
    Does anyone knows what could be the problem.
    Thanks in advance!

    Hello!
    That isn't the problem the test connection works fine but when I try provisioning a user the shell script execute some instructions, in the shell script I need to set the timeout property in order to give more time to finish execute the instructions before the script execute the following command.
    I tested the timeout property in the shell script and work to fine for IDM 8 patch 4 I upgrade to patch 10 and stopped to work.
    Does anyone knows What could be the rigth way to set the timeout property in a resource action for shell script resource?
    Thanks...

  • Automator Shell Script

    Hi,
    I am very new to Automator and know the very basics about Unix but use Terminal frequently for very repetitive tasks (which I usually find on the web) - one of which is creating MD5 of all files within a specific folder. To achieve this I generally open Terminal, go to a specific project folder and enter: find . -print0 | xargs -0 -I{} md5 "$@"{} >> md5.chk
    This then creates a txt file called md5.chk within the folder which lists all off the files within that folder (with file path) as well as all the the associated checksums for these files.
    I would like to streamline this process a little by creating a service with Automator so I can select a Folder within Finder and select the require Service.
    Unfortunately I am not getting very far. This is where I am:
    1. Open Automator and select Service
    2. Add "Get Specified Finder Items" action
    3. Add "Run Shell Script" action (Pass input: as argument) with the following: find . -print0 | xargs -0 -I{} md5 "$@"{} >> md5.chk
    Unfortunately this doesn't achieve the required result. I presume there are some elements within the shell script that I am simply missing. Can anyone help?
    Thanks

    This is a test. It is ONLY a test.
    Change your Automator "Run Shell Script" to:
    ( pwd
    echo "+++++"
    /bin/ls -dlae0@ .
    echo "+++++"
    id -a
    echo "+++++"
    echo "number of args: $#"
    echo "+++++"
    printenv
    echo "+++++"
    echo find "$@" -type f -print0
    echo "+++++"
    find "$@" -type f -print0 | xargs -0 -I{} echo "{}"
    ) >/tmp/tmp.txt
    Then look at /tmp/tmp.txt and see if the expanded command look they it should. You can get to the /tmp directory using Finder -> Go -> Go to Folder -> /tmp
    The double-quotes will be missing (as the shell will swallow them), however, what you are interested in is did the "$@" expand to the desired directory.
    The pwd will tell us what the current working directory is. This could be important, as maybe you do not have permissions to use that directory.
    The /bin/ls will tell us the ownership and permissions of the current working directory.
    The id -a will tell us what account the automator script is running as
    The $# will tell us how many arguments were passed as part of the "$@"
    The printenv will tell us what environment variables have been set.
    The find|xargs is changed to replace md5 with echo, so that we can see that the "{}" expanded to.

  • Executing a shell script with DBMS_SCHEDULER

    Hi,
    when I execute a shell script with DBMS_SCHEDULER this doesn't works correctly
    BEGIN
    DBMS_SCHEDULER.create_job
    job_name => 'job_AR',
    job_type => 'EXECUTABLE',
    job_action => '/home/crm/crmdw/AR/start_execution.sh',
    enabled => TRUE,
    start_date => systimestamp,
    repeat_interval => 'FREQ=MINUTELY;INTERVAL=15',
    comments => 'Test Job AR'
    END;Inside the shell script there is a code who call a Hierarchy of process,
    if I executed it manually or with a cron, it works perfectly
    but when I execute it with the job that I've described before it's executes
    all process at same time and it doesn't work.
    What can I do to fix the issue,
    any Ideas?
    Thanks in advanced...

    #!/usr/bin/ksh
    #test_dbms_scheduler.ksh
    echo $1
    echo "I am in Unix"
    exit 0
    chmod 755 test_dbms_scheduler.ksh
    Create or replace procedure test_dbms_scheduler
    as
    v_text varchar2(255) := 'Parameter passed from Oracle to Unix';
    Begin
    dbms_output.put_line("I am in Procedure");
    dbms_scheduler.create_job
    (job_name=>'test_dbms_scheduler',
    job_action=>'/usr/bin/test_dbms_scheduler.ksh',
    number_of_arguments=>1,
    job_type=>'executable',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=SECONDLY; INTERVAL=1',
    enabled=>false,
    auto_drop => TRUE,
    comments=> 'Run shell-script test_dbms_scheduler.ksh');
    dbms_scheduler.set_job_argument_value(job_name =>'test_dbms_scheduler', argument_position => 1, argument_value => v_text);
    dbms_scheduler.enable('test_dbms_scheduler');
    dbms_output.put_line("I am back in Procedure");
    Exception
    when others then
    dbms_output.put_line(sqlcode||sqlerrm);
    end;
    set serveroutput on
    exec test_dbms_scheduler;

  • Shell script connection issues

    I'm after some advice.
    In our development enviroment we pull data from a content database using a shell script by setting the ORACLE_SID within the script and
    we then check we can connect. Like our production environment our content and 'normal' database reside on the same server and under these conditions
    everything works OK.
    ORACLE_SID=$TARGET_DB
    DB_CONNECT=`sqlplus -s $USER/$PASS <<EOF
    whenever sqlerror exit failure
    whenever oserror exit failure
    select 1 from dual;
    EOF`
    However I now have access to a test content database with full production data but it resides on a different server. I can tnsping the other database and connect form the unix prompt with sqlplus user/pwd@newdb. However my shell script now gives
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SVR4 Error: 2: No such file or directory
    The same also occurs if I do the same manually at the UNIX prompt.
    Unfortunately I don't currently have access to a DBA so I am on my own (although I do have full access to both database and operating system on the development box).
    Thanks in advance,
    Steve

    Steve,
    Everything is normal. Using ORACLE_SID is limited to local -IPC/Bequeath- connections on the same server.
    Assuming you don't want two different methods to connect, you'd best set up an IPC connection in your tnsnames.ora to connect to the local database ,
    using ((PROTOCOL=IPC)(KEY=<whatever you used in listener.ora>)), and use the normal tns connection for the remote database.
    In that case you can use the @<servicename in tnsnames.ora> all the time.
    Alternatively you can replace @<servicename> by
    set TWO_TASK=<servicename>
    sqlplus ... <without @...>
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • How to pass password to an lftp connection using shell script

    Hi
    I need to transfer a file to server which support FTPS protocol. I am using lftp utility for this purpose. User credentials used to establish the connection expires after a period(eg: 45 days/3 months) . Can anyone guide me with me an approach to use the password in the shell script which transfer the file to the remote server other than hard coding the password in the script.
    Thanks
    Ramya

    SSH is a better option but unfortunately it's not always available. If you worry about security, you could use the bookmark lftp feature:
    $ lftp ftp://username@server
    Password:
    lftp username@server:~>  set bmk:save-passwords true
    lftp username@server:~> bookmark add yourserver
    lftp username@server:~> bookmark list
    lftp username@server:~> quit
    $ lftp yourserver &
    $ ps -aux | grep lftp
    The password is stored in ~/.lftp/bookmarks (not encrypted) but you can protect the file with the right permissions as you would do with your certificates with SSH.

  • How to test oracle is up and running in remote machine using shell script

    Hello,
    I need help to write an linux script.
    I have a java application server running on machine 192.168.5.20 and our oracle 10g standard 1.0.2 is running on machine 192.168.5.21.
    I have found script to start oracle when computer is turned on.
    But I cannot start my application server automatically since it depends on whether oracle is up and running or not on the remote machine.
    Therefore, in case of power failure or maintenance, our client has to call us to start application server.
    I would be grateful if someone can help me "How can I write script to check oracle is up and running in machine 192.168.5.21 from machine 192.168.5.20.
    For your information, I have no oracle installed in application server. So tnsping won't work.
    What I want is when power is back, application server script automatically and tesing for oracle server is up and running. If it is up, script will start application server.
    Thanking you.

    Hi,
    It's not failover or experimental. My application server uses JBOSS and JBOSS needs database name to start up. My enviroment is LAN. My database is in different machine as I mentioned before. So In case of power failure, I need to start my application server (JBoss) manually, because I need to confirm that oracle is already running before start app server.
    I want an automated script (when power is just on) to start my application server which will wait to check if the datbase server is up I will start application server.
    The scripts given above It works if appserver and db server in the same machine (my development machine).
    But when I test the script in my production applicaiton server, It shows sqlplus command not found (my app server does not have any oracle client installed).
    About hostname yes My applicaiton server hostname is hostapp1 and dabase server hostname is hostdat1.
    Do you think Is it possible to test the script without oracle client not installed. or It has to be done writing code like java program and test using jdbc connection.
    Best regards.

  • Rel 12 - How to create a new APPS connection from custom Java/Shell Script

    Hi,
    I am looking to write a custom JAVA code / Shell Script which needs to establish a connection to execute a PL/SQL API on Rel 12 db.
    The challenge is to be able to connect without specifying APPS Password anywhere (just like Oracle Apps does it).
    This Shell script / Java code is not called from within Apps hence I need to establish a brand new connection along the lines of using ....
    WebAppsContext ctx = new WebAppsContext(System.getProperty("JTFDBCFILE"));
    OracleConnection conn = (OracleConnection)ctx.getJDBCConnection();
    like in 11i world or possibly using APPLSYSPUB username
    I need help / direction in how to do this in a Rel 12 env. I understnad there are lot of architecture changes and if someone can provide a generic code snipped it will be great.
    I need to keep this as closely aligned to Rel 12 coding and security standards as possible.
    This code will reside in $XXCUSTOM_TOP/bin file or under XXCUSTOM.oracle.apps.java....... if its Java.
    Pls help.
    Cheers
    -- VK.

    Hi,
    Have you looked at Oracle produced dbc file and its contents? That might help. It is under $FND_TOP/secure. It uses GWYUID=APPLSYSPUB/PUB. I am hoping that the APPS_JDBC_URL would help too.
    Regards,

  • Add Password to Shell Script for ssh

    Hi I'm trying to avoid creating ssh keys for this I was hoping to write it all in to applescript.
    This is what I have.
    I've done lots of searches, but not quite getting the right outcome.
    Matt
    set ShellS to "rsync -aE --progress --delete --exclude=\"._*\" /Volumes/Images/2014-2015 [email protected]:/Volumes/ImagesB/ "
    do shell script ShellS

    Thanks, that did help, I wondered what all those extra files were,
    Now searching the net this is where I am at., But I get the error
    error "invalid command name \"rsync\"
        while executing
    \"rsync -a --progress --delete --exclude=\"._*\" -e ssh /Volumes/Images/2014-2015 [email protected]:/Volumes/ImagesB/ \"" number 1
    set sshPasswd to "PSW"
    set ShellS to "rsync -a --progress --delete --exclude=\"._*\" -e ssh /Volumes/Images/2014-2015 [email protected]:/Volumes/ImagesB/
    expect {
      \"Password:\" {
          send \"" & sshPasswd & "\\r\"
          exp_continue
        \"yes/no?\" {
          send \"yes\\r\"
          exp_continue
    do shell script "expect <<<" & quoted form of ShellS

  • Help regarding issue connecting to DB through shell script

    Hi,
    I have a Oracle 8.1.7 Database running on a AIX box. I am trying to truncate one table from within the shell script using here documents.
    Code section of my script -
    succ=`sqlplus -s ${USR} << EOF
    whenever sqlerror exit sql.sqlcode
    set feedback on
    Truncate table abc.xyz;
    exit;
    EOF`
    USR has been set as /. We have ops$ users in the database. So when I run this script using my id it runs fine. The problem seems to be coming when this runs as part of the batch job which runs under a different osuser. The error is -
    + + sqlplus -s /
    + 0< /tmp/sh164108.8
    succ=ERROR:
    ORA-01017: invalid username/password; logon denied
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
    where <logon> ::= <username>[<password>][@<connect_string>] | /
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    I am not sure what is going wrong. I have tried and googled for the issue and it seems that the issue is coming because the osuser under which the job runs may not be setup to use "sqlplus -s /" ? Any help appreciated.
    Regards,
    Saurabh

    This is the forum for Oracle's SQL Developer tool, not for general SQL and PL/SQL questions.Questions like this will get a better response in the PL/SQL forum.
    Having said that, it looks likely that the other user doesn't have an ops$ account.

  • Shell script login ssh

    Quick question with a quick answer, how can I make my shell script enter the login password to my remote server?
    Ex.
    #!/bin/sh
    ssh (user)@(ip here)
    (enter password)
    ...and so on...

    In addition to using keys. it would be advisable to limit what commands can be run using
    the key.
    see: sshd(8): under the "AUTHORIZED_KEYS FILE FORMAT" section.
    command="command"
    Specifies that the command is executed whenever this
    key is used for authentication. The command supplied
    by the user (if any) is ignored. The command is run on
    a pty if the client requests a pty; otherwise it is run
    without a tty. If an 8-bit clean channel is required,
    one must not request a pty or should specify no-pty. A
    quote may be included in the command by quoting it with
    a backslash. This option might be useful to restrict
    certain public keys to perform just a specific
    operation. An example might be a key that permits
    remote backups but nothing else. Note that the client
    may specify TCP/IP and/or X11 forwarding unless they
    are explicitly prohibited. Note that this option
    applies to shell, command or subsystem execution.

Maybe you are looking for