If you can ssh to it, you can sftp to it. It's the same port right?
You can check it with a tcpdump on your interfaces, you will see the "sftp" command making noise on your guest.
Go deeper by looking in your log files (/var/log/) especially /var/log/auth.log with tail -f while you are trying to log in.
I don't get why you are using this command to connect via ssh to your guest. What you are doing is telling ssh to listen and forward traffic arriving on your guest's port 10022 to 127.0.0.1 port 22.
Just do:
ssh [email protected]
assuming 10.0.2.2 is your VM. To use sftp just do:
sftp [email protected]
If the first works and not the second, it's a configuration problem, I guess. Provide us with more input if the problem persists.
sftp -vvv
? What ssh daemon are you running inside the guest, does it includesftp-server
?Subsystem sftp /usr/libexec/sftp-server
(same line as in hostsshd_config
. Maybe I'm not issuing the correct command, but can't find out how:$ sftp -vvv -oBindAddress=21222 [email protected] OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /home/user/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to 10.0.2.2 [10.0.2.2] port 22. Couldn't read packet: Connection reset by peer