0

i got a new computer and trying to connect to the same sftp that i've used for years, i used an ftp client and i got a new one, but i get refusal to connect. I tried connecting with terminal and also was denied altough after 3 attempts it seemed the server was reached but got disconnected right away:

Permission denied (publickey,password,keyboard-interactive).

Connection closed

I tested the ports on my computer with nmap:

time nmap -p 22 portquiz.net

and got results of port 22 being open:

PORT   STATE SERVICE

22/tcp open ssh

and then i scanned more ports and got a lot of open ports btu also a line that says:

Not shown: 955 closed tcp ports (conn-refused)

Not sure of if this means that there's many closed ports and if so why? but in any case there's also many open ports, none of them is listed as an sftp port tho, port 21 is listed as ftp, but also port 22 doesn't show up in the list of the second nmap command i did:

time nmap portquiz.net

please let me know a possible solution? thanks, i'm using a mac with ventura, in case this matters.

6
  • You have not given sufficient information fir us to solve your problem, but I can narriw it down. The issue is not a network or firewall issue - it has to do with the setup within the server rejecting the connection. (SFTP uses ssh and port 22 is accessible. The message you arevfetting is ssh specifically receiving the connection request and rejecting the sessuon.
    – davidgo
    Commented Mar 27, 2023 at 9:53
  • Try running ssh (or the command-line sftp client) with the "-v" option to print debugging output, then edit your question to show the exact ssh or sftp command that you ran along with the debugging output. Include any relevant entries from your .ssh/config file.
    – Kenster
    Commented Mar 27, 2023 at 12:43
  • Can you please provide me with the exact command to run, i'm not a developper and don't really know what exatly you mean, my guess is : sftp username@server_ip -v
    – julianlede
    Commented Mar 27, 2023 at 14:59
  • is this correct?
    – julianlede
    Commented Mar 27, 2023 at 15:00
  • My old computer on my same home network is connecting with no issues so i wonder why would the server reject a request coming from the same IP? and what would be the issue that the server administrator need to correct on their end?
    – julianlede
    Commented Mar 27, 2023 at 15:05

1 Answer 1

1

If you get a Permission denied error message from SSH, that means you were successfuly talking to the SSH server up until that point – you connected to it, your client was able to start the authentication process and everything. Which means ports are definitely not the problem.

My old computer on my same home network is connecting with no issues so i wonder why would the server reject a request coming from the same IP? and what would be the issue that the server administrator need to correct on their end?

The rejection is not based on IP address, it's based on the user login information (password or SSH keypair) that you provided. Assuming you're providing the correct keypair (id_rsa, etc.), the server administrator can look at the server's sshd logs to find out why it is still being rejected.

(It's of course possible that your client just isn't sending the correct keypair, or the correct password. Check with ssh -v ... first.)

i used an ftp client and i got a new one, but i get refusal to connect.

FTP/FTPS is not SFTP. They're different protocols, hosted by different software, and they will be running on different ports (SFTP uses the SSH port).

Some clients support both (e.g. Cyberduck and Transmit certainly do SFTP in addition to FTP/FTPS), but even in those cases you need to specifically select SFTP (not to be confused with FTPS).

none of them is listed as an sftp port tho

Because it's listed as an SSH port, exactly like in your first nmap (the one with -p 22).

1
  • thanks for the replies. so i still haven't been able to find the issue, my computer connects to other test SFTP servers without a problem and also my old computer still connects successfully to the server in question i have, so i ran a command to compare the info on the process of requesting the ssh connection on both the old and new computers, the only difference i see between both is that the host keys are different. what are potential problems on the server side that need to be looked into, how would the IT person be able to determent the blockage on their end, what should they look into?
    – julianlede
    Commented Mar 31, 2023 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .