Setting up a chrooted sftponly system for users in a specific group
Resource followed - https://www.techrepublic.com/article/how-to-use-sftp-with-a-chroot-jail/
Other options that look ok - https://www.tecmint.com/restrict-sftp-user-home-directories-using-chroot/ and https://linuxize.com/post/how-to-set-up-sftp-chroot-jail/
LEARN VI PEEPS :) https://www.openvim.com/
Command in the video
1 clear
2 sudo groupadd sftponly
3 sudo useradd -g sftponly -s /bin/false -m -d /home/mysftpuser mysftpuser
4 man useradd
5 sudo passwd mysftpuser
6 sudo chown root: /home/mysftpuser
7 sudo chmod 755 /home/mysftpuser/
8 sudo ls -l /home
9 sudo mkdir /home/mysftpuser/ftpup
10 sudo mkdir /home/mysftpuser/ftpdown
11 set -o vi
12 sudo chmod 755 /home/mysftpuser/ftp*
13 sudo chown mysftpuser:sftponly /home/mysftpuser/ftp*
14 sudo vi /etc/ssh/sshd_config
15 sudo systemctl restart sshd.service
16 sudo su -
17 history
-As root I copied ec2-user .ssh over and changed things... Commands not shown
18 sudo chown root:sftponly /home/mysftpuser/.ssh
19 sudo chmod 750 /home/mysftpuser/.ssh
20 sudo chown mysftpuser:sftponly /home/mysftpuser/.ssh/authorized_keys
Other Videos By Information Technology
2022-12-16 | Has your social media been hacked - Watch this video to find out what to do - even the secret stuff |
2022-12-16 | I received the CompTIA Secure Infrastructure Specialist – CSIS Stackable Certification |
2022-12-15 | I got the CompTIA IT Operations Specialist – CIOS Stackable Certification |
2022-12-14 | I passed the CompTIA Network+ Certification Exam |
2022-12-13 | I got the CompTIA Systems Support Specialist – CSSS Stackable Certification |
2022-12-12 | Children |
2022-12-12 | I passed the Linux+ certification exam from CompTIA |
2022-11-08 | Launch EC2 From AWS Lambda - This was done using an AWS Academy Learner Lab Account |
2022-10-13 | Create Random Files in Learners Home Directories |
2022-10-13 | Create 90 SFTP Only Users With a Single Command |
2022-10-13 | Setting up a chrooted sftponly system for users in a specific group |
2022-10-13 | Understanding Network Connections and installing Cups - Why do we print so much, arg! EC2 Metadata |
2022-10-13 | Setup and Apache Web Server on AWS EC2 |
2022-10-13 | Systems Administrators Should Learn From Others Mistakes - Look at Standards |
2022-10-13 | Playing with Split, Cat and Diff in linux using AWS |
2022-09-23 | Finding files in linux and then doing something with that information (locate, find, updatedb, exec) |
2022-09-22 | Linux Cut, Paste, Sort, Uniq, Tr, and Egrep - lets play |
2022-09-22 | Cost of EC2 in AWS and touching on how to learn Regular Expressions |
2022-09-22 | Getting ready to certify in Amazon Web Services (AWS)... Watch this video to get some tips |
2022-09-19 | Setup a StarBound server in AWS on ubuntu |
2022-09-15 | Some great features of the Canvas LMS and my course setup best practices |