Operating System - HP-UX
1823085 Members
3412 Online
109646 Solutions
New Discussion юеВ

Re: Command For Name Of Host Machine At the sftp>

 
Raymond Ford
Advisor

Command For Name Of Host Machine At the sftp>

What is the command for the name of the host machine at the sftp> prompt?
I'm an apprentice among journeymen who spend a lot of time on the virtual road.
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Command For Name Of Host Machine At the sftp>

Normally it's uname. Try "uname -n".


Pete

Pete
RAC_1
Honored Contributor

Re: Command For Name Of Host Machine At the sftp>

on sftp prompt, if you type ?/help it should give you all commands supported.

Check it.

Anil
There is no substitute to HARDWORK
Mel Burslan
Honored Contributor

Re: Command For Name Of Host Machine At the sftp>

on regular ftp interface if you issue command status, on the first line of output you can see the name of the host you are connected to. I do not think sftp user interface is any different
________________________________
UNIX because I majored in cryptology...
Jeff Schussele
Honored Contributor

Re: Command For Name Of Host Machine At the sftp>

Hi,

Not sure about sftp, but the command in ftp is
ftp> status
First line of the output will be the hostname.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Denver Osborn
Honored Contributor

Re: Command For Name Of Host Machine At the sftp>

I don't know of any sftp cmd to show what host you'r logged into. You could either get a file from the host and look for the hostname, or escape to a shell and see where you're going to.


sfpt> lcd /tmp
sftp> get /etc/rc.config.d/netconf
sftp> !grep HOSTNAME netconf

or

sftp> !
ps |grep sftp
ps -ef |grep PID-of-sftp |grep ssh


-denver
Colin Topliss
Esteemed Contributor

Re: Command For Name Of Host Machine At the sftp>

Hmm.

! opens a local shell (ie a shell on the system you initiated the connection from, not the machine you connected to).

So, sftp from machine_A to machine_B,
!uname -n
will give you machine_A

But you know what system you are on, and what you're connecting to already, right???

Best think I can think of (assuming this is part of a script) is to run an ssh command first:

ssh user@machine_B uname -n

Then do your sftp. Takes an extra connection, but it will work if the name of machine_B is what you are after.
Tom Dineen_2
Advisor

Re: Command For Name Of Host Machine At the sftp>

when I run sftp.exe from my desktop, it shows me:

fsftp: no hostname specified; use "open host.name" to connect

enter: help

enter: open
you should see login prompt, like:




some tricks might be:

lcd change to local client dir

!pwd list client's working dir