Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Installs Samba and sets up an SMB instance on a RHEL-like Linux box.
- # Execute this script on a VM or remote server.
- set -ex
- SMB_USER="devadmin"
- SMB_PASS="devadmin"
- # Ensure the Samba package is installed
- if [! rpm-qa | grep -qw samba]; then
- sudo yum install samba -y
- fi
- # Enabled SMB sharing
- sudo chkconfig smb on
- # Create a new SMB user/password of devadmin/devadmin
- echo -ne "$SMB_PASS\n$SMB_PASS\n" | sudo smbpasswd -as $SMB_USER
- # Restart the SMB service
- sudo service smb restart
- echo "SMB is configured and /home/$SMB_USER is ready for sharing"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement