Monday, 15 July 2013

How to check SFTP connection if SSH port is different.

SFTP is protocol which is know as Secure File Transfer protocol. Unlike normal FTP, SFTP uses encryption method to transfer file. It is a prerequisite that, a user who need to use SFTP must have shell access. A jail shell access will be also fine.

Now, how to check it via command line, whether a user is having a SFTP or not.

To start an SFTP session, at the command prompt, enter:

====
sftp username@hostipaddress
=== 

the above example can be used when SSH port is 22.

Now, if the SSH port is a different one, then we have to use the below command:
====
sftp -oPort=sshportnumber username@hostipaddress.
====

Suppose SSH port is 1122, then use the command as follows:
====
sftp -oPort=1122 manoj@11.12.13.14
==== 

Some of the common SFTP commands are listed below:
====
cd Change the directory on the remote computer.
chmod Change the permissions of files on the remote computer.
chown Change the owner of files on the remote computer.
exit (or quit) Close the connection to the remote computer and exit SFTP.
get Copy a file from the remote computer to the local computer.
help (or ?) Get help on the use of SFTP commands.
lcd Change the directory on the local computer.
lls List the contents of the current directory on the local computer.
lmkdir Create a directory on the local computer.
ln (or symlink) Create a symbolic link for a file on the remote computer.
lpwd Show the current directory (present working directory) on the local computer.
ls (or dir) List the contents of the current directory on the remote computer.
lumask Change the local umask value.
mkdir Create a directory on the remote computer.
put Copy a file from the local computer to the remote computer.
pwd Show the current directory (present working directory) on the remote computer.
rename Rename a file on the remote computer.
rm Delete a file on the remote computer.
rmdir Remove a directory on the remote computer (the directory usually has to be empty).
version Display the SFTP version. 

=====








No comments:

Post a comment

Note: only a member of this blog may post a comment.