SFTP - using port numbers?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SFTP - using port numbers?
# 1  
Old 12-07-2012
SFTP - using port numbers?

Hi Guys,

I saw this line of code in a script

Code:
sftp username@hostname#2200
get file

and the script never asked for password. Can you please explain on this?Smilie
# 2  
Old 12-07-2012
This means your username from where you are running this script is having a direct access to the hostname which you are trying to reach and get the require file.
# 3  
Old 12-07-2012
SFTP never asked for password because SSH password-less login must be setup. #2200 is just a comment. The proper syntax to specify port number is:-
Code:
sftp -oPort=2200 username@hostname

# 4  
Old 12-07-2012
@bipinajith:

when I try to run this in terminal
Code:
sftp username@hostname

it prompts for password. Why so?

@Vikram tanwar: your answer seems to reasonable. But still Smilie
# 5  
Old 12-07-2012
OK

can you show us your code ?
# 6  
Old 12-07-2012
The whole code is just to get a file Smilie
# 7  
Old 12-07-2012
That's two lines of code, not one, and wouldn't work as-is. Please show the original code.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

2. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies

3. UNIX for Dummies Questions & Answers

sftp with specified port #

how can i sftp with a specified port# (port # 10022). i tried sftp hostname:10022 - did not work i tried sftp -P 10022 hostname - did not work thanks in advance. (6 Replies)
Discussion started by: lawsongeek
6 Replies

4. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

5. IP Networking

TCP port numbers reused

Hello all, I am loosing the diameter connection between two servers and when the connection is trying to comes up again i see the following message in the tracer. and after 1 second the connection resets. As far i know the connection stay in state TIME_WAIT for a while(60 seconds in my... (1 Reply)
Discussion started by: @dagio
1 Replies

6. Shell Programming and Scripting

Need help in finding and replacing port numbers.

Hi All, I am trying to write a shell script which firstly will search some files and then increase the port numbers mentioned in them by a certain no. let me clear it with an example- suppose there r few files a,b,c,d.... file a's content- <serverEntries xmi:id="ServerEntry_1"... (3 Replies)
Discussion started by: ankushsingh10
3 Replies

7. Programming

Cloning a socket connection, using other port numbers

Hello everybody, I've coded a multi-client server based on internet sockets using the scheme listen on port X-accept-fork, exactly like beej's guide At some point I would like to establish a secondary connection between a client and the server-child serving him. I was considering the... (4 Replies)
Discussion started by: jonas.gabriel
4 Replies

8. IP Networking

how to find port numbers a web server is listening to

I want to write a program to list all port numbers a process like web server is listening to.Is there a any unix command to find the port numbers and the processes(pid) connected to that port. (6 Replies)
Discussion started by: laddu
6 Replies

9. IP Networking

finding port numbers

hither! whatz the command to find which process is using a specific port number? for example, port 8082? (3 Replies)
Discussion started by: darkcastle
3 Replies
Login or Register to Ask a Question