LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2014, 08:01 AM   #1
Ave3
LQ Newbie
 
Registered: Oct 2014
Posts: 15

Rep: Reputation: Disabled
psftp


Hello,

The ssh port of my remote machine is changed from 22 to another number, I have problem to change it in the psftp, now I can not locate to the host machine, I can not open the ssh_config file to change the ssh port number. Now I have problem to transfer any file from my local machine to the host machine.
Any suggestion please how to connect to the host through the sftp?

Thanks,
 
Old 11-30-2014, 08:23 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Did you restart ssh to reload the new settings?
Did you change the firewall if running on the remote machine to accept incoming connections on the new port?

Have you tried:
psftp -P New_Port_number remote_machine_name
or
psftp -P New_Port_number IP.address.remote.machine

Last edited by michaelk; 11-30-2014 at 08:24 AM.
 
Old 11-30-2014, 01:44 PM   #3
Ave3
LQ Newbie
 
Registered: Oct 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
Yes, I have tried both psftp -P New_Port_number remote_machine_name and psftp -P New_Port_number IP.address.remote.machine, but it doesn´t recognise any command as psftp, cat or vim.
I can't restart the ssh while no command is working on it.
I don't know how to change the firewall on my remote machine.
 
Old 11-30-2014, 07:59 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
What distribution/version is on the remote machine?
Do you have physical access to the remote machine?

psftp is a windows sftp client. Are you trying to run cat and vim on a windows or the remote machine?
 
Old 12-01-2014, 01:44 PM   #5
Ave3
LQ Newbie
 
Registered: Oct 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
I don't know which version is on the remote machine and I don't have physical access to the remote machine.
Yes, I am trying to run cat and vim on a windows not the remote machine because I need to change the port number on my local computer but most of the commands are not working on psftp here not even the listing command "lls" , any suggestion?
 
Old 12-01-2014, 02:56 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
but most of the commands are not working on psftp
I don't understand. Sounds like you started psftp but not logged into the remote machine. Can you log on to the remote machine via PuTTY? To run commands on the remote machine like cat and vim you need to use PuTTY not psftp.

If you can not log in to the remote machine using ssh via PuTTY due to the changes in port number and you have no other means to access the computer then someone with physical access must change your ssh settings back.

I might suggest using a windows sftp client to transfer files like WinSCP or Filezilla.

Last edited by michaelk; 12-01-2014 at 02:58 PM.
 
1 members found this post helpful.
Old 12-01-2014, 03:22 PM   #7
Ave3
LQ Newbie
 
Registered: Oct 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
I can log in to the remote machine via Putty and run all the commands on the remote machine, my problem is I have many files on my local machine that I need to transfer to the remote machine, now I can not transfer them after the ssh port was changed.
as I read about it I can change the port number in psftp in sshd-config file there though I am not sure I have this file or not.
I started to use putty 4 weeks ago and I found it fine until this problem appeared.
 
Old 12-01-2014, 03:50 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
sshd_config is for configuring the server not the client. The same port number used for PuTTY is the same that you use for psftp. What happens when you try running psftp using the above using the command posted above. You can also start psftp and select the port with the open command.

Again it might be easier using a GUI client instead of a psftp
 
Old 12-01-2014, 04:10 PM   #9
Ave3
LQ Newbie
 
Registered: Oct 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
Smile

Changing the port number in Putty is easy just make it in the Putty window, but for psftp I think in the first time when you log in to the sever it asks you about the secure server and on when you chose yes it saves it in sshd-config and will stay there until you change it manually. any how now I downloaded winSCP it looks very easy and quick I didn't know about that until u said it, I think it is the best way to transfer the files in between local and remote machines. psftp made me tired I will let it as its, I don't need it any more. Thank you for your help michaelk.
 
Old 12-01-2014, 04:25 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Just for your information you can start psftp using the -P option as stated in my earlier post or if you just click psftp from the file browser you get the sftp command prompt and can log in using the port number like:

sftp> open server 1234

You will then be asked the username and password. Typing in a ? (help) will display a list of ftp commands.

Just ask if you need help with winSCP.
 
Old 12-01-2014, 04:52 PM   #11
Ave3
LQ Newbie
 
Registered: Oct 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
I have tried it several times but it didn't work, it says unknown command "sftp" as for the other commands it says, when I try to open it with open command as before "open host name" or "open -p new port number host name" the psftp window was disappearing this time I mean after the port number was changed. I have checked help for the commands they are not many and sftp is not listed there.
Thank you for offering more help.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced PSFTP scripting Singing Banzo Linux - Software 2 07-16-2007 02:57 PM
Psftp (SSH) Client connection issue, Pls Help, TQ.. garychwm Linux - Networking 2 10-09-2005 02:02 AM
pscp, psftp through port 80? nbcthreat Linux - Networking 2 07-08-2004 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:15 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration