Skip to content
Snippets Groups Projects
Unverified Commit bb114304 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

add script to create user account for the ssh session

parent 08da2f93
No related branches found
No related tags found
No related merge requests found
sudo useradd -m -s /bin/bash -g users -G adm,docker,dialout,cdrom,floppy,audio,dip,video,plugdev,netdev $1
sudo cp /etc/skel/.* /home/$1
sudo passwd $1 << EOF
$1
$1
EOF
# scp -i ~/.ssh/id_ifb ssh_session_init.sh ssh_session_adduser.sh 2020_participants_mail.txt ubuntu@134.158.247.127:
# ssh -i ~/.ssh/id_ifb ubuntu@134.158.247.127
# bash ssh_session_init.sh 2020_participants_mail.txt
cat $1 | sed -e "s/@[^,]*[,]*//g" | tr ' ' '\n' | awk '{system("bash ssh_session_adduser.sh "$0)}'
sudo sed -i 's|PasswordAuthentication no|PasswordAuthentication yes|' /etc/ssh/sshd_config
sudo systemctl restart sshd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment