tags:

views:

249

answers:

3

How can we verify that SFTP access has been granted on a server - without installing any software/tools?

Thank you in advance Mark

A: 

G'day,

What about telnet on to port 115 (if we're talking Simple FTP) and see what happens when you connect. If you don't get refused try sending a USER command, then a PASS command, and then a QUIT command.

HTH

cheers,

Rob Wells
A: 

Try logging in.

Not being snarky -- that really is probably the simplest way. By 'verify[ing] that SFTP access has been granted," what you're really doing is checking is a particular l/p pair is recognized by the server.

anschauung
+1  A: 

Most servers have curl and scp installed, which you can use to log into an SFTP server. To test if your credentials work using curl, you could do this:

$ curl -u username sftp://example.org/
Enter host password for user 'username':

Enter your password and if it works you'll get a listing of files (like ls -al), if it doesn't work you'll get an error like this:

curl: (67) Authentication failure

You could also try using scp:

$ scp [email protected]:testing .
Password:
scp: testing: No such file or directory

This verifies that you that you were able to log in, but it couldn't find the testing file. If you weren't able to log in you'd get a message like this:

Permission denied, please try again.
Received disconnect from example.org: 2: ...error message...
lost-theory