LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 07-21-2005, 09:25 AM   #1
cefs99
LQ Newbie
 
Registered: May 2005
Distribution: redhat EL
Posts: 7

Rep: Reputation: 0
how to use different port for sftp?


Hi guys,

I am wondering how to tell sftp to use port other than 22 to connect other ssh server?

seems simply sftp 1.1.1.1 -oPort=2222 as `man sftp` said doesnt work



anyone had experience?


Tks,

Hong
 
Old 07-21-2005, 09:48 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371Reputation: 2371
Hi,

You need to set up the ssh daemon to listen to the port(s) you want to connect on.
This also implies the need to ssh and scp on that port......

In your sshd_config these 2 take care of this:
- ListenAddress
- Port

If port is used, all addresses (ip numbers) listen on that port. Setting specific ports on specific ip's/adresses is possible too: Do not set the port value (remove it) and do something like this:
ListenAddress 200.01.01.01:32
ListenAddress 192.168.1.1:22

The outside (fake ip 200.01.01.01) world needs to use port 32, the local network (192.168.1.1) can use the default port (22).

See man sshd en sshd_config for details.

Hope this helps.
 
Old 07-22-2005, 03:16 AM   #3
cefs99
LQ Newbie
 
Registered: May 2005
Distribution: redhat EL
Posts: 7

Original Poster
Rep: Reputation: 0
Tks, but I think I failed to describe my problem clearly.


I know how to set sshd to listen at different port other than 22.

but after I set my sshd to listen at, say, 2222 port. I need to know how to use sftp connect to this server from another linux box in command line.


I know how to connect via ssh:

ssh 1.1.1.1 -p 2222


but how to use sftp?

man sftp said used -oPort=2222 but doesnt work. sftp still said failed to connect to port 22


any idea?


tks,

Hong
 
Old 07-22-2005, 07:04 AM   #4
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Rep: Reputation: 31
Try...

Code:
sftp -oPort=2222 user@123.456.789.012:/home/something
Note: The -oPort=???? has to be before the user@123......

Last edited by Linux~Powered; 07-22-2005 at 07:20 AM.
 
1 members found this post helpful.
Old 07-22-2005, 08:15 AM   #5
cefs99
LQ Newbie
 
Registered: May 2005
Distribution: redhat EL
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you so much, it works perfectly!
 
Old 11-13-2012, 09:08 PM   #6
corepuncher
LQ Newbie
 
Registered: Feb 2005
Location: Norman, OK
Distribution: Fedora Core 3
Posts: 12

Rep: Reputation: 0
Quote:
Originally Posted by cefs99 View Post
thank you so much, it works perfectly!
yes thank you works great! :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sftp jefffq Linux - General 7 06-29-2005 02:27 AM
How do I use sftp to upload my web site? (no sftp tar command) johnMG Linux - Networking 6 06-21-2005 09:14 PM
cannot SFTP to SUSE 9.2 box, port 22 open, can putty in though using same port. jgrady Linux - Networking 6 03-29-2005 08:44 AM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 10:29 AM
sftp rafalek *BSD 2 12-11-2003 06:55 PM


All times are GMT -5. The time now is 02:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration