Ssh – sftp with anonymous user

anonymoussftpssh

How I can set a anonymous sftp user ?

I generate the ssh keys pair, set /usr/lib/sftp-server as shell in /etc/password and share the private key (id_rsa) and with this command the users get access

 sftp -oIdentityFile=id_rsa public_sftp@host

is a good idea ?

Best Answer

You can't.

sftp logs you in via ssh - there has to be an account that you log into.
You can share the account (create multiple keypairs, or just pass out the private key to everyone who needs access), but there is no equivalent of plain-old-FTP's "anonymous" user and no password.

You could use FTPS (Plain old FTP, wrapped in SSL) to do this though.