sftp

1840  sudo apt-get install openssh-server
1841  nm-connection-editor 
1842  sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults
1843  sudo chmod a-w /etc/ssh/sshd_config.factory-defaults
1844  sudo -H gedit /etc/ssh/sshd_config


sudo usermod -d /var/www sftpuser1

ubuntu2@ubuntu2:~$ cat /etc/ssh/sshd_config 
PermitRootLogin yes
Subsystem sftp /usr/lib/openssh/sftp-server

ubuntu2@ubuntu2:~$ sudo service ssh start
ssh start/running, process 13776


ubuntu@ubuntu:/var/www2$ sftp sftpuser1@192.168.40.129
sftpuser1@192.168.40.129's password: 
Connected to 192.168.40.129.
sftp> pwd
Remote working directory: /var/www
---------------------------------

sftpuser1@ubuntu:~/.ssh$ ssh-keygen 
sftpuser1@ubuntu:~/.ssh$ ssh-copy-id -i sftpuser1@192.168.40.129

sftpuser1@ubuntu:~/.ssh$ sftp -vvv -o IdentityFile=id_rsa sftpuser1@192.168.40.129

sftpuser1@ubuntu2:~/.ssh$ cat authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8HA5Lv12FJabfjXkkxBEvZt6fgnJJMqtkW1HQUz7a76mmPsXvpXtaDTlQYxkhDRDIgQu+cLZ2xC5D5xvE3xkxHRNSqm+uQ+hXYEOTFOXbXZ5jBGuZA6K2DkXeapa0F6ELvYRp96DQH1WKGl6NVlVkK9RfLe90zRKhscozppKhWK9hKk1FGINhZ6m9e+YE0JHtGh+w2qvWv5X/WplidKmkyfPDNwiyEIE1nNDBVQ8/w/09H6djzAqgkPBALqKmP6L+YLokiiFD7BhLnZ3Fx7InUwiy24YXIo+Pn12veHWE4s4CCx14LE2wSxukXTLHiSeJcn+FV3gyiqD8GqySCXcp sftpuser1@ubuntu

added key into known_hosts file
sftpuser1@ubuntu:~/.ssh$ cat known_hosts 
|1|XaC67jqu5VXVeXQDY/Fbu1vE8N8=|Gpg3Y+or50OVPqu1koSQyCbSDLk= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGD6Y/9sdol9Xc1HRdkbz/covxS9S5N50ldkIxX6xCxihQ1POy47HoYlJ/aw/2A3mitX7Hga9vbZqReCUxRa/Pk=

Comments

Popular posts from this blog

HAproxy logging

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all

teamcity Automatic Agent Start under Linux