Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

We have a process that is using a working secured port using this scp command like so:

/usr/bin/scp -P 1234 -i /path/key_rsa /home/path/filename.txt user@remotehost:/tmp

I'm working on a schell script, that will use ssh, but not sure how to use that same port of 1234.

I tried /usr/bin/ssh -D 1234 remotehost '. ~/my_profile; mkdir /test' and its asking for the user pw. I know the keys are already established since the scp works fine for that user.

What am I doing wrong? Thanks.

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You want to use the -p option; -D is for dynamic port forwarding, that is to say creating port forwardings on an existing connection.

share|improve this answer
    
thanks! –  jdamae Mar 5 '11 at 1:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.