Friday, July 25, 2008

Setting up an ssh / sftp server in ubuntu

Using OpenSSH: http://www.openssh.com/

sudo apt-get install openssh-server


More information here:
https://help.ubuntu.com/community/SSHHowto
http://tombuntu.com/index.php/2008/02/19/installing-and-using-a-ssh-server/

Edited config file at /etc/ssh/sshd_config and set:
PermitRootLogin no
AllowUsers
Port #####

This site has good tips on SSH server security.

Command to restart ssh server:

sudo /etc/init.d/ssh restart

Setting up SFTP logging:

1) edit /etc/ssh/sshd_config
2) on the line Subsystem sftp /usr/lib/openssh/sftp-server, add a "-l VERBOSE" flag. So the entire line should look like:

Subsystem sftp /usr/lib/openssh/sftp-server -l VERBOSE

SFTP activity will be logged to /var/log/auth.log. For more logging options, see http://www.openbsd.org/cgi-bin/man.cgi?query=sftp-server&sektion=8

No comments: