Create 90 SFTP Only Users With a Single Command

Subscribers:
1,220
Published on ● Video Link: https://www.youtube.com/watch?v=29L4m15kMQY



Duration: 8:58
29 views
1


This video builds off of https://youtu.be/4TceWF0IRQI

We will create 90 test users so that learners can log in and upload/download files... I may may one more in this series.

Added the users
Prepopulated home directory with the .ssh information
Setup unique keys for every account
tested logging in with my primary key and an accounts newly created key

Sorry about having to remove Angled Brackets

[root@ip-172-31-81-162 ~]# for a in {10..100}; do useradd -g sftponly -s /bin/false -m -d /home/sftpuser${a} sftpuser${a}; cp -pr /home/mysftpuser/.ssh /home/sftpuser${a}/.; chown sftpuser${a}:sftponly /home/sftpuser${a}/.ssh/authorized_keys; sudo chown root: /home/sftpuser${a}; sudo chmod 755 /home/sftpuser${a}
ssh-keygen -q -t rsa -N '' -f /home/sftpuser${a}/.ssh/id_rsa ***REMOVED***y; cat /home/sftpuser${a}/.ssh/id_rsa.pub ***REMOVED*** /home/sftpuser${a}/.ssh/authorized_keys; done^C
[root@ip-172-31-81-162 ~]# history

50 exit
51 clear
52 exit
53 clear
54 for a in {10..100}; do useradd -g sftponly -s /bin/false -m -d /home/sftpuser${a} sftpuser${a}; cp -pr /home/mysftpuser/.ssh /home/sftpuser${a}/.; chown sftpuser${a}:sftponly /home/sftpuser${a}/.ssh/authorized_keys; sudo chown root: /home/sftpuser${a}; sudo chmod 755 /home/sftpuser${a}
ssh-keygen -q -t rsa -N '' -f /home/sftpuser${a}/.ssh/id_rsa ***REMOVED***y; cat /home/sftpuser${a}/.ssh/id_rsa.pub ***REMOVED*** /home/sftpuser${a}/.ssh/authorized_keys; done
55 ssh -i /home/sftpuser10/.ssh/id_rsa sftpuser10@localhost
56 sftp -i /home/sftpuser10/.ssh/id_rsa sftpuser10@localhost
57 history




Other Videos By Information Technology


2022-12-19CompTIA says I'm a professional - CompTIA Linux Network Professional – CLNP Stackable Certification
2022-12-16Has your social media been hacked - Watch this video to find out what to do - even the secret stuff
2022-12-16I received the CompTIA Secure Infrastructure Specialist – CSIS Stackable Certification
2022-12-15I got the CompTIA IT Operations Specialist – CIOS Stackable Certification
2022-12-14I passed the CompTIA Network+ Certification Exam
2022-12-13I got the CompTIA Systems Support Specialist – CSSS Stackable Certification
2022-12-12Children
2022-12-12I passed the Linux+ certification exam from CompTIA
2022-11-08Launch EC2 From AWS Lambda - This was done using an AWS Academy Learner Lab Account
2022-10-13Create Random Files in Learners Home Directories
2022-10-13Create 90 SFTP Only Users With a Single Command
2022-10-13Setting up a chrooted sftponly system for users in a specific group
2022-10-13Understanding Network Connections and installing Cups - Why do we print so much, arg! EC2 Metadata
2022-10-13Setup and Apache Web Server on AWS EC2
2022-10-13Systems Administrators Should Learn From Others Mistakes - Look at Standards
2022-10-13Playing with Split, Cat and Diff in linux using AWS
2022-09-23Finding files in linux and then doing something with that information (locate, find, updatedb, exec)
2022-09-22Linux Cut, Paste, Sort, Uniq, Tr, and Egrep - lets play
2022-09-22Cost of EC2 in AWS and touching on how to learn Regular Expressions
2022-09-22Getting ready to certify in Amazon Web Services (AWS)... Watch this video to get some tips
2022-09-19Setup a StarBound server in AWS on ubuntu