Change Port in SFTP

25 pts.
Tags:
AS/400
SFTP
I want to change the Port for connection to 11422. How can I change in below command:
CHGVAR VAR(&CMD) +
VALUE('PATH=$PATH:/QOpenSys/usr/bin && +
sftp -b /home/sftpadp/script.txt +
$SFTP_USER@$SFTP_HOST')
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    Try changing your command to:
    CHGVAR VAR(&CMD) +
           VALUE('PATH=$PATH:/QOpenSys/usr/bin && +
                    sftp -b /home/sftpadp/script.txt +
                    -o Port=11422 +
                    $SFTP_USER@$SFTP_HOST') 

    33,610 pointsBadges:
    report
  • Anks123
    Thanks so much for help! I have tried as below and it worked..

    CHGVAR     VAR(&CMD) +                                 
                 VALUE('PATH=$PATH:/QOpenSys/usr/bin && +  
                 sftp -vvv -b /home/sftpadp/script.txt -P +
                 11422 $SFTP_USER@$SFTP_HOST')             

    but now it is not authorizing the public key :( .. and log as below,

    debug1: Next authentication method: publickey                                   
    debug1: Offering RSA public key: /home/sftpadp/.ssh/id_rsa                      
    debug3: send_pubkey_test                                                        
    debug2: we sent a publickey packet, wait for reply                              
    debug1: Authentications that can continue: password,publickey,keyboard-interacti
    debug1: Trying private key: /home/sftpadp/.ssh/id_dsa                           
    25 pointsBadges:
    report
  • TheRealRaven
    You used the "-P" option rather than the "-o" option that was suggested. Did you try with "-o"? There have been cases where "-P" was not working as expected. I have no info yet on why there might be a difference.

    What is your OS version? What version of OpenSSH do you have installed.
    33,610 pointsBadges:
    report
  • Anks123
    My OS version is : V7R1 and Open SSH version: 4.7
    25 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: