Missing argument for option: n Error


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Missing argument for option: n Error
# 8  
Old 02-07-2017
Look up the various authentication methods in man ssh, e.g. "public key authentication" will do what you request.
This User Gave Thanks to RudiC For This Post:
# 9  
Old 02-14-2017
Hi,

When I run the below script from other unix server in same network It ask password and need to give it manually. Is there anyway how to give the password for other server when it's in the same network in the below script .

Code:
#!/bin/sh
ssh -t user@server "cd /home/runAJobCli/; bash" ./Myscript.sh $1 $2

What will be the syntax.


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 02-15-2017 at 06:54 AM.. Reason: Added CODE tags.
# 10  
Old 02-15-2017
Did you make any progress compared to post#7? Did you try "public key authentication"?
# 11  
Old 02-15-2017
Hi RudiC,

Basically the script will be executed by Control-M scheduler and does this require Public Authentication key or can I keep the password in the script and what will be the syntax. Because what I heard is the Public Authentication Key is not required for the Control- M execution. Please correct me if I am wrong.
# 12  
Old 02-15-2017
I've absolutely no clue what "Control-M" is and how it possibly works and interoperates with other applications. But, you're using ssh in your script, and, reading between your lines, some authentication IS required to fulfill your needs. "Public key auth." is one option for this amongst others.
Its setup is described in ssh's man page and in many contributions in these fora, so it wouldn't make sense to repeat it for the n+1. time. Try it yourself and come back when you're stuck.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find: missing argument to `-mtime'

this find command works when using manually on the command line -- $ ls -latr file*.log -rw-r--r-- 1 oracle dba 75 Jan 4 05:00 file_2.log -rw-r--r-- 1 oracle dba 75 Jan 4 05:00 file_1.log $ $ find . ! -name -prune -type f -name "file*.log" -daystart -mtime 2 ./file_1.log ./file_2.log $... (8 Replies)
Discussion started by: wtolentino
8 Replies

2. Shell Programming and Scripting

ksh - default value for getopts option's argument

Hello everyone, I need help in understanding the default value for getopts option's argument in ksh. I've written a short test script: #!/bin/ksh usage(){ printf "Usage: -v and -m are mandatory\n\n" } while getopts ":v#m:" opt; do case $opt in v) version="$OPTARG";; ... (1 Reply)
Discussion started by: da1
1 Replies

3. Shell Programming and Scripting

passing an option as an argument!

Hi Folks I have got to the point where I can specify the arguments but how to pass an option is still mystery to me. Example: temp.csh a b c d set temp1 = $argv set temp2 = $argv set temp3 = $argv echo $temp1 a echo $temp2 b echo $temp3 c d I WANT: temp.csh a b c d -S 1 set temp1... (2 Replies)
Discussion started by: dixits
2 Replies

4. UNIX for Advanced & Expert Users

Error:--test: argument expected--Even though i give an argument.

Hi All, I am running the script VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt result=`cat har1out.mytxt | grep $1' echo $result echo $1 { if then echo pass else echo fail fi (2 Replies)
Discussion started by: harsha85
2 Replies

5. Shell Programming and Scripting

find: missing argument to `-exec' while redirecting using find in perl

Hi Friends, Please help me to sort out this problem, I am running this in centos o/s and whenever I run this script I am getting "find: missing argument to `-exec' " but when I run the same code in the command line I didn't find any problem. I am using perl script to run this ... (2 Replies)
Discussion started by: ramkumarselvam
2 Replies

6. Shell Programming and Scripting

command-line line 0: Missing yes/no argument

Hi Guys When I run the below command ssh -o 'PasswordAuthentication yes' -o 'PreferredAuthentications publickey' -i $HOME/.ssh/id_dsa Server_Name I found the below error ommand-line line 0: Missing yes/no argument Kindly help me to sort out Double post, continued... (0 Replies)
Discussion started by: Pratik4891
0 Replies

7. Shell Programming and Scripting

Cannot compare argument in if statement in csh/grep command if argument starts with “-“

If ($argv == “-debug”) then Echo “in loop” Endif But this is not working. If I modify this code and remove “-“, then it works. Similarly I am getting problem using grep command also Grep “-debug” Filename Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies

8. Shell Programming and Scripting

option followed by : taking next option if argument missing with getopts

Hi all, I am parsing command line options using getopts. The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument. Below is the script: while getopts :hd:t:s:l:p:f: opt do case "$opt" in -h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies

9. Solaris

ps: 65535 is an invalid non-numeric argument for -p option

I want to figure out what is the reason of error message I have in Solaris 10. Why Solaris 10 dosn't recognize 65535? ps: 65535 is an invalid non-numeric argument for -p option usage: ps 'format' is one or more of: Thank you (5 Replies)
Discussion started by: gogogo
5 Replies
Login or Register to Ask a Question