Ver código fonte

First commit from mlab8

Master Splinter 4 anos atrás
commit
0091999b7e
9 arquivos alterados com 492 adições e 0 exclusões
  1. 21 0
      autologout.sh
  2. 10 0
      lightdm_cleanup.sh
  3. 68 0
      mlab_cleanup.sh
  4. 8 0
      settings1
  5. 8 0
      settings2
  6. 8 0
      settings3
  7. 123 0
      sshd_config
  8. 123 0
      sshd_config_allow
  9. 123 0
      sshd_config_deny

+ 21 - 0
autologout.sh

@@ -0,0 +1,21 @@
+sudo bash -c 'echo "sudo pkill -u mlab1" | at 11:45'
+sudo bash -c 'echo "sudo pkill -u mlab2" | at 11:45'
+sudo bash -c 'echo "sudo pkill -u mlab3" | at 11:45'
+sudo bash -c 'echo "sudo /usr/local/bin/mlab_cleanup.sh" | at 11:45'
+sudo bash -c 'echo "sudo pkill -u mlab1" | at 14:45'
+sudo bash -c 'echo "sudo pkill -u mlab2" | at 14:45'
+sudo bash -c 'echo "sudo pkill -u mlab3" | at 14:45'
+sudo bash -c 'echo "sudo /usr/local/bin/mlab_cleanup.sh" | at 14:45'
+sudo bash -c 'echo "sudo pkill -u mlab1" | at 17:45'
+sudo bash -c 'echo "sudo pkill -u mlab2" | at 17:45'
+sudo bash -c 'echo "sudo pkill -u mlab3" | at 17:45'
+sudo bash -c 'echo "sudo /usr/local/bin/mlab_cleanup.sh" | at 17:45'
+sudo bash -c 'echo "sudo pkill -u mlab1" | at 20:45'
+sudo bash -c 'echo "sudo pkill -u mlab2" | at 20:45'
+sudo bash -c 'echo "sudo pkill -u mlab3" | at 20:45'
+sudo bash -c 'echo "sudo /usr/local/bin/mlab_cleanup.sh" | at 20:45'
+sudo bash -c 'echo "sudo cp /usr/local/sshd_config_deny /etc/ssh/sshd_config" | at 20:45'
+sudo bash -c 'echo "sudo service network-manager restart" | at 20:45'
+sudo bash -c 'echo "sudo cp /usr/local/sshd_config_allow /etc/ssh/sshd_config" | at 08:45'
+sudo bash -c 'echo "sudo service network-manager restart" | at 08:45'
+sudo bash -c 'echo "sudo /usr/local/autologout.sh" | at 08:45'

+ 10 - 0
lightdm_cleanup.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+if [[ "$USER" == "mlab1" ]]; then
+	/usr/local/bin/mlab_cleanup.sh
+fi
+if [[ "$USER" == "mlab2" ]]; then
+        /usr/local/bin/mlab_cleanup.sh
+fi
+if [[ "$USER" == "mlab3" ]]; then
+        /usr/local/bin/mlab_cleanup.sh
+fi

+ 68 - 0
mlab_cleanup.sh

@@ -0,0 +1,68 @@
+#!/bin/bash
+rm -rf /home/mlab1
+rm -rf /home/mlab2
+rm -rf /home/mlab3
+cp -a /etc/skel /home/mlab1
+cp -a /etc/skel /home/mlab2
+cp -a /etc/skel /home/mlab3
+mkdir -p /home/mlab1/Desktop
+mkdir -p /home/mlab2/Desktop
+mkdir -p /home/mlab3/Desktop
+chown -R mlab1:mlab1 /home/mlab1
+chown -R mlab2:mlab2 /home/mlab2
+chown -R mlab3:mlab3 /home/mlab3
+cp /home/splinter/Desktop/arduino-arduinoide.desktop /home/mlab1/Desktop/
+cp /home/splinter/Desktop/arduino-arduinoide.desktop /home/mlab2/Desktop/
+cp /home/splinter/Desktop/arduino-arduinoide.desktop /home/mlab3/Desktop/
+chown mlab1:mlab1 /home/mlab1/Desktop/arduino-arduinoide.desktop
+chown mlab2:mlab2 /home/mlab2/Desktop/arduino-arduinoide.desktop
+chown mlab3:mlab3 /home/mlab3/Desktop/arduino-arduinoide.desktop
+#wget --no-check-certificate "https://onedrive.live.com/download?cid=DCDE13AE659ED1B2&resid=DCDE13AE659ED1B2%2175916&authkey=AGepsYTZ9Pa1uNc" --directory-prefix=/usr/local/
+wget --no-check-certificate "https://onedrive.live.com/download?cid=DCDE13AE659ED1B2&resid=DCDE13AE659ED1B2%2176000&authkey=ACQ2WcEJomWlHLI" --directory-prefix=/usr/local/
+#mv /usr/local/download\?cid\=DCDE13AE659ED1B2\&resid\=DCDE13AE659ED1B2\!75916\&authkey\=AGepsYTZ9Pa1uNc /usr/local/easyAvr6sim
+mv /usr/local/download\?cid\=DCDE13AE659ED1B2\&resid\=DCDE13AE659ED1B2\!76000\&authkey\=ACQ2WcEJomWlHLI /usr/local/easyAvr6sim
+chmod +x /usr/local/easyAvr6sim
+cp /usr/local/easyAvr6sim /home/mlab1/Desktop/
+cp /usr/local/easyAvr6sim /home/mlab2/Desktop/
+cp /usr/local/easyAvr6sim /home/mlab3/Desktop/
+cp /usr/local/EasyAVR.png /home/mlab1/Desktop/
+cp /usr/local/EasyAVR.png /home/mlab2/Desktop/
+cp /usr/local/EasyAVR.png /home/mlab3/Desktop/
+mkdir /home/mlab1/.ssh
+mkdir /home/mlab2/.ssh
+mkdir /home/mlab3/.ssh
+cp /usr/local/authorized_keys /home/mlab1/.ssh/authorized_keys
+cp /usr/local/authorized_keys /home/mlab2/.ssh/authorized_keys
+cp /usr/local/authorized_keys /home/mlab3/.ssh/authorized_keys
+chown -R mlab1:mlab1 /home/mlab1/.ssh/
+chown -R mlab2:mlab2 /home/mlab2/.ssh/
+chown -R mlab3:mlab3 /home/mlab3/.ssh/
+chmod 600 /home/mlab1/.ssh/authorized_keys
+chmod 600 /home/mlab2/.ssh/authorized_keys
+chmod 600 /home/mlab3/.ssh/authorized_keys
+chown mlab1:mlab1 /home/mlab1/Desktop/EasyAVR.png
+chown mlab1:mlab1 /home/mlab1/Desktop/easyAvr6sim
+chown mlab2:mlab2 /home/mlab2/Desktop/EasyAVR.png
+chown mlab2:mlab2 /home/mlab2/Desktop/easyAvr6sim
+chown mlab3:mlab3 /home/mlab3/Desktop/EasyAVR.png
+chown mlab3:mlab3 /home/mlab3/Desktop/easyAvr6sim
+cp /usr/local/sshd_config_allow /etc/ssh/sshd_config
+cp /usr/local/settings1 /home/mlab1/Desktop/settings
+cp /usr/local/settings2 /home/mlab2/Desktop/settings
+cp /usr/local/settings3 /home/mlab3/Desktop/settings
+chown mlab1:mlab1 /home/mlab1/Desktop/settings
+chown mlab2:mlab2 /home/mlab2/Desktop/settings
+chown mlab3:mlab3 /home/mlab3/Desktop/settings
+cp -r /home/splinter/.arduino15 /home/mlab1/.arduino15
+cp -r /home/splinter/.arduino15 /home/mlab2/.arduino15
+cp -r /home/splinter/.arduino15 /home/mlab3/.arduino15
+chown -R mlab1:mlab1 /home/mlab1/.arduino15/
+chown -R mlab2:mlab2 /home/mlab2/.arduino15/
+chown -R mlab3:mlab3 /home/mlab3/.arduino15/
+chmod +x /usr/local/terminal.desktop
+cp /usr/local/terminal.desktop /home/mlab1/Desktop/terminal.desktop
+cp /usr/local/terminal.desktop /home/mlab2/Desktop/terminal.desktop
+cp /usr/local/terminal.desktop /home/mlab3/Desktop/terminal.desktop
+chown -R mlab1:mlab1 /home/mlab1
+chown -R mlab2:mlab2 /home/mlab2
+chown -R mlab3:mlab3 /home/mlab3

+ 8 - 0
settings1

@@ -0,0 +1,8 @@
+resolution=1280x1024
+offsetX=223
+offsetY=730
+imageOffsetX=0
+imageOffsetY=-30
+simPort=/dev/simulator1
+uploadPort=/dev/avr1
+arduinoPath=/usr/local/arduino-1.8.13/hardware/tools/avr/bin/avrdude -C/home/mlab1/.arduino15/packages/MightyCore/hardware/avr/2.0.6/avrdude.conf -v -patmega16 -carduino -P

+ 8 - 0
settings2

@@ -0,0 +1,8 @@
+resolution=1280x1024
+offsetX=223
+offsetY=730
+imageOffsetX=0
+imageOffsetY=-30
+simPort=/dev/simulator2
+uploadPort=/dev/avr2
+arduinoPath=/usr/local/arduino-1.8.13/hardware/tools/avr/bin/avrdude -C/home/mlab2/.arduino15/packages/MightyCore/hardware/avr/2.0.6/avrdude.conf -v -patmega16 -carduino -P

+ 8 - 0
settings3

@@ -0,0 +1,8 @@
+resolution=1280x1024
+offsetX=223
+offsetY=730
+imageOffsetX=0
+imageOffsetY=-30
+simPort=/dev/simulator3
+uploadPort=/dev/avr3
+arduinoPath=/usr/local/arduino-1.8.13/hardware/tools/avr/bin/avrdude -C/home/mlab3/.arduino15/packages/MightyCore/hardware/avr/2.0.6/avrdude.conf -v -patmega16 -carduino -P

+ 123 - 0
sshd_config

@@ -0,0 +1,123 @@
+#	$OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
+
+# This is the sshd server system-wide configuration file.  See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented.  Uncommented options override the
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_ecdsa_key
+#HostKey /etc/ssh/ssh_host_ed25519_key
+
+# Ciphers and keying
+#RekeyLimit default none
+
+# Logging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+#PermitRootLogin prohibit-password
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#PubkeyAuthentication yes
+
+# Expect .ssh/authorized_keys2 to be disregarded by default in future.
+#AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2
+
+#AuthorizedPrincipalsFile none
+
+#AuthorizedKeysCommand none
+#AuthorizedKeysCommandUser nobody
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+PasswordAuthentication no
+#PermitEmptyPasswords no
+
+# Change to yes to enable challenge-response passwords (beware issues with
+# some PAM modules and threads)
+ChallengeResponseAuthentication no
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+#GSSAPIStrictAcceptorCheck yes
+#GSSAPIKeyExchange no
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+UsePAM yes
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+X11Forwarding yes
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PermitTTY yes
+PrintMotd no
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#UseDNS no
+#PidFile /var/run/sshd.pid
+#MaxStartups 10:30:100
+#PermitTunnel no
+#ChrootDirectory none
+#VersionAddendum none
+
+# no default banner path
+#Banner none
+
+# Allow client to pass locale environment variables
+AcceptEnv LANG LC_*
+
+# override default of no subsystems
+Subsystem	sftp	/usr/lib/openssh/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+#	X11Forwarding no
+#	AllowTcpForwarding no
+#	PermitTTY no
+#	ForceCommand cvs server
+AllowUsers splinter kube mlab

+ 123 - 0
sshd_config_allow

@@ -0,0 +1,123 @@
+#	$OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
+
+# This is the sshd server system-wide configuration file.  See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented.  Uncommented options override the
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_ecdsa_key
+#HostKey /etc/ssh/ssh_host_ed25519_key
+
+# Ciphers and keying
+#RekeyLimit default none
+
+# Logging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+#PermitRootLogin prohibit-password
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#PubkeyAuthentication yes
+
+# Expect .ssh/authorized_keys2 to be disregarded by default in future.
+#AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2
+
+#AuthorizedPrincipalsFile none
+
+#AuthorizedKeysCommand none
+#AuthorizedKeysCommandUser nobody
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+PasswordAuthentication no
+#PermitEmptyPasswords no
+
+# Change to yes to enable challenge-response passwords (beware issues with
+# some PAM modules and threads)
+ChallengeResponseAuthentication no
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+#GSSAPIStrictAcceptorCheck yes
+#GSSAPIKeyExchange no
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+UsePAM yes
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+X11Forwarding yes
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PermitTTY yes
+PrintMotd no
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#UseDNS no
+#PidFile /var/run/sshd.pid
+#MaxStartups 10:30:100
+#PermitTunnel no
+#ChrootDirectory none
+#VersionAddendum none
+
+# no default banner path
+#Banner none
+
+# Allow client to pass locale environment variables
+AcceptEnv LANG LC_*
+
+# override default of no subsystems
+Subsystem	sftp	/usr/lib/openssh/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+#	X11Forwarding no
+#	AllowTcpForwarding no
+#	PermitTTY no
+#	ForceCommand cvs server
+AllowUsers splinter kube mlab mlab1 mlab2 mlab3

+ 123 - 0
sshd_config_deny

@@ -0,0 +1,123 @@
+#	$OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
+
+# This is the sshd server system-wide configuration file.  See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented.  Uncommented options override the
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_ecdsa_key
+#HostKey /etc/ssh/ssh_host_ed25519_key
+
+# Ciphers and keying
+#RekeyLimit default none
+
+# Logging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+#PermitRootLogin prohibit-password
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#PubkeyAuthentication yes
+
+# Expect .ssh/authorized_keys2 to be disregarded by default in future.
+#AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2
+
+#AuthorizedPrincipalsFile none
+
+#AuthorizedKeysCommand none
+#AuthorizedKeysCommandUser nobody
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+PasswordAuthentication no
+#PermitEmptyPasswords no
+
+# Change to yes to enable challenge-response passwords (beware issues with
+# some PAM modules and threads)
+ChallengeResponseAuthentication no
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+#GSSAPIStrictAcceptorCheck yes
+#GSSAPIKeyExchange no
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+UsePAM yes
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+X11Forwarding yes
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PermitTTY yes
+PrintMotd no
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#UseDNS no
+#PidFile /var/run/sshd.pid
+#MaxStartups 10:30:100
+#PermitTunnel no
+#ChrootDirectory none
+#VersionAddendum none
+
+# no default banner path
+#Banner none
+
+# Allow client to pass locale environment variables
+AcceptEnv LANG LC_*
+
+# override default of no subsystems
+Subsystem	sftp	/usr/lib/openssh/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+#	X11Forwarding no
+#	AllowTcpForwarding no
+#	PermitTTY no
+#	ForceCommand cvs server
+AllowUsers splinter kube mlab