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:200](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L200-L206)
 * 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:692](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L692-L719)
 * 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:731](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L731-L733)
 * 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:572](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L572-L574)
 * 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:770](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L770-L833)
 * 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:584](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L584-L586)
 * 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:596](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L596-L598)
 * 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:608](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L608-L610)
 * 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:620](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L620-L623)
 * 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:633](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L633-L635)
 * 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:645](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L645-L647)
 * 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:657](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L657-L659)
 * 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:674](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L674-L676)
 * 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:269](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L269-L271)
 * 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:518](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L518-L530)
 * 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:284](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L284-L294)
 * 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:544](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L544-L562)
 * 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:303](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L303-L311)
 * 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:321](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L321-L323)
 * 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:336](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L336-L346)
 * 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:360](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L360-L380)
 * 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:393](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L393-L403)
 * 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:63](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L63-L112)
 * 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:413](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L413-L431)
 * 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:121](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L121-L185)
 * 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:441](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L441-L443)
 * 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:216](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L216-L246)
 * 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:453](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L453-L471)
 * 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:257](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L257-L259)
 * 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:486](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-filesystem-ssh2.php#L486-L498)

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)