Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # Installs Samba and sets up an SMB instance on a RHEL-like Linux box.
  3. # Execute this script on a VM or remote server.
  4.  
  5. set -ex
  6.  
  7. SMB_USER="devadmin"
  8. SMB_PASS="devadmin"
  9.  
  10. # Ensure the Samba package is installed
  11. if [! rpm-qa | grep -qw samba]; then
  12. sudo yum install samba -y
  13. fi
  14.  
  15. # Enabled SMB sharing
  16. sudo chkconfig smb on
  17.  
  18. # Create a new SMB user/password of devadmin/devadmin
  19.  
  20. echo -ne "$SMB_PASS\n$SMB_PASS\n" | sudo smbpasswd -as $SMB_USER
  21.  
  22. # Restart the SMB service
  23. sudo service smb restart
  24.  
  25. echo "SMB is configured and /home/$SMB_USER is ready for sharing"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement