Title: wp-admin/includes/class-wp-filesystem-ssh2.php | Developer.WordPress.org

---

# File: wp-admin/includes/class-wp-filesystem-ssh2.php

 * method[WP_Filesystem_SSH2::sftp_path()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/sftp_path/)
 * Gets the ssh2.sftp PHP stream wrapper path to open for the given file.
 * Used by [14 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/sftp_path/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/sftp_path/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:249](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L249-L255)
 * method[WP_Filesystem_SSH2::mkdir()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/mkdir/)
 * Creates a directory.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/mkdir/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/mkdir/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:759](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L759-L789)
 * method[WP_Filesystem_SSH2::rmdir()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/rmdir/)
 * Deletes a directory.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/rmdir/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/rmdir/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:801](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L801-L803)
 * method[WP_Filesystem_SSH2::dirlist()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/dirlist/)
 * Gets details for files in a directory or a specific file.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/dirlist/#used-by)
   | Uses [10 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/dirlist/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:841](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L841-L904)
 * method[WP_Filesystem_SSH2::exists()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/exists/)
 * Checks if a file or directory exists.
 * Used by [5 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/exists/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/exists/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:637](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L637-L639)
 * method[WP_Filesystem_SSH2::is_file()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_file/)
 * Checks if resource is a file.
 * Used by [3 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_file/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_file/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:649](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L649-L651)
 * method[WP_Filesystem_SSH2::is_dir()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_dir/)
 * Checks if resource is a directory.
 * Used by [4 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_dir/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_dir/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:661](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L661-L663)
 * method[WP_Filesystem_SSH2::is_readable()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_readable/)
 * Checks if a file is readable.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_readable/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_readable/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:673](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L673-L675)
 * method[WP_Filesystem_SSH2::is_writable()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_writable/)
 * Checks if a file or directory is writable.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_writable/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/is_writable/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:685](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L685-L688)
 * method[WP_Filesystem_SSH2::atime()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/atime/)
 * Gets the file’s last access time.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/atime/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/atime/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:698](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L698-L700)
 * method[WP_Filesystem_SSH2::mtime()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/mtime/)
 * Gets the file modification time.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/mtime/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/mtime/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:710](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L710-L712)
 * method[WP_Filesystem_SSH2::size()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/size/)
 * Gets the file size (in bytes).
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/size/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/size/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:722](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L722-L724)
 * method[WP_Filesystem_SSH2::touch()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/touch/)
 * Sets the access and modification times of a file.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/touch/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/touch/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:740](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L740-L743)
 * method[WP_Filesystem_SSH2::chown()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chown/)
 * Changes the owner of a file or directory.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chown/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chown/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:448](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L448-L458)
 * method[WP_Filesystem_SSH2::owner()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/owner/)
 * Gets the file owner.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/owner/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/owner/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:468](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L468-L486)
 * method[WP_Filesystem_SSH2::getchmod()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/getchmod/)
 * Gets the permissions of the specified file or filepath in their octal format.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/getchmod/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/getchmod/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:496](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L496-L502)
 * method[WP_Filesystem_SSH2::group()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/group/)
 * Gets the file’s group.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/group/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/group/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:512](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L512-L530)
 * method[WP_Filesystem_SSH2::copy()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/copy/)
 * Copies a file.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/copy/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/copy/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:545](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L545-L557)
 * method[WP_Filesystem_SSH2::move()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/move/)
 * Moves a file or directory.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/move/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/move/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:577](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L577-L592)
 * method[WP_Filesystem_SSH2::__construct()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/__construct/)
 * Constructor.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/__construct/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/__construct/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:98](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L98-L152)
 * method[WP_Filesystem_SSH2::delete()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/delete/)
 * Deletes a file or directory.
 * Used by [3 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/delete/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/delete/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:606](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L606-L627)
 * method[WP_Filesystem_SSH2::connect()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/connect/)
 * Connects filesystem.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/connect/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/connect/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:161](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L161-L234)
 * method[WP_Filesystem_SSH2::run_command()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/run_command/)
 * Used by [4 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/run_command/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/run_command/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:267](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L267-L297)
 * method[WP_Filesystem_SSH2::get_contents()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/get_contents/)
 * Reads entire file into a string.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/get_contents/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/get_contents/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:308](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L308-L310)
 * method[WP_Filesystem_SSH2::get_contents_array()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/get_contents_array/)
 * Reads entire file into an array.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/get_contents_array/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/get_contents_array/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:320](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L320-L322)
 * method[WP_Filesystem_SSH2::put_contents()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/put_contents/)
 * Writes a string to a file.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/put_contents/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/put_contents/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:335](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L335-L345)
 * method[WP_Filesystem_SSH2::cwd()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/cwd/)
 * Gets the current working directory.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/cwd/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/cwd/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:354](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L354-L366)
 * method[WP_Filesystem_SSH2::chdir()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chdir/)
 * Changes current directory.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chdir/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chdir/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:376](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L376-L378)
 * method[WP_Filesystem_SSH2::chgrp()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chgrp/)
 * Changes the file group.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chgrp/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chgrp/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:391](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L391-L401)
 * method[WP_Filesystem_SSH2::chmod()](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chmod/)
 * Changes filesystem permissions.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chmod/#used-by)
   | Uses [4 functions](https://developer.wordpress.org/reference/classes/wp_filesystem_ssh2/chmod/#uses)
   | Source: [wp-admin/includes/class-wp-filesystem-ssh2.php:415](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L415-L435)

1 [2](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-filesystem-ssh2.php/page/2/?output_format=md)

 [Next Page](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-filesystem-ssh2.php/page/2/?output_format=md)