mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-25 23:14:54 +02:00
Fix formatting of SFTP examples
parent
f1d4c634a4
commit
ababdebd02
@ -1,16 +1,23 @@
|
|||||||
- Setup sftp-server on host
|
## Setup `sftp-server` on host
|
||||||
- Add location of sftp-server.exe binary as a subsystem in sshd_config file by adding an entry like below:
|
|
||||||
- `Subsystem sftp sftp-server.exe`
|
|
||||||
- Restart sshd.exe
|
|
||||||
- sftp-server will now be started automatically by sshd server when a sftp client connects to this computer
|
|
||||||
|
|
||||||
- sftp.exe examples
|
* Add location of sftp-server.exe binary as a subsystem in sshd_config file by adding this entry:
|
||||||
- `sftp test1@localhost //login to local machine using test1 username`
|
* `Subsystem sftp sftp-server.exe`
|
||||||
- `sftp -i .ssh/id_rsa test1@remotehost //login using .ssh/id_rsa public key pair`
|
* Restart sshd.exe
|
||||||
- `pwd //show current remote directory`
|
* `Restart-Service sshd`
|
||||||
- `lpwd //show current local directory`
|
* `sftp-server` will now be started automatically by `sshd` when an SFTP client connects to the host
|
||||||
- `cd /tests //changed to remote directory c:/tests`
|
|
||||||
- `get file1.txt //download file1.txt from remote system to local directory`
|
## Using `sftp.exe`
|
||||||
- `put file1.txt //upload the file to remote system from the current local directory`
|
|
||||||
- `exit`
|
This example connects to the local machine (`localhost`) as the user `test1`, and downloads/uploads some files.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sftp test1@localhost //login to local machine using test1 username
|
||||||
|
sftp -i .ssh/id_rsa test1@remotehost //login using .ssh/id_rsa public key pair
|
||||||
|
pwd //show current remote directory
|
||||||
|
lpwd //show current local directory
|
||||||
|
cd /tests //changed to remote directory c:/tests
|
||||||
|
get file1.txt //download file1.txt from remote system to local directory
|
||||||
|
put file2.txt //upload the file to remote system from the current local directory
|
||||||
|
exit
|
||||||
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user