The thing is the PERMISSION can be of GROUP/USER.
So let's see Users first.
- root - the O'might one in linux
- There is also a root group
- Then there is wheel
- There are a few places to look at
- /etc/sudoers or visudo - same file
- Enable wheel group
- Search for "# %wheel ALL=(ALL)ALL", and remove hash to enable
- /etc/passwd
- Enable user/s in group directory for access and bash login
- Verify user in which group
- Terminal# su USERNAME -
- Terminal# groups
- There are also users like your administrators, users, APACHE and so on...
So now we come to Groups.
- Group : root
- ## Allow root run any commands anywhere
- "root ALL=(ALL) ALL"
- So DO NOT anyhow tamper with anything you DO NOT know~!
- Group : wheel
- ## Allow people in group wheel to run all commands
- "%wheel ALL=(ALL) ALL"
- OR
- ## Same thing without a password
- "%wheel ALL=(ALL) NOPASSWD: ALL"
Linux Command : chown
- To change user and/or group ownership of file/directory
- chown owner-user "file"
- chown owner-user:owner-group "file"
- chown owner-user:owner-group "directory"
- chown <options> owner-user:owner-group "file"
For /etc/hostapd and /etc/hostapd/hostapd.conf to be accessible by web server, (user: apache)
- Changing the owner-user and owner-group of /etc/hostapd/ (directory) and /etc/hostapd/hostapd.conf (file) to apache:wheel
- Terminal# chown apache:wheel /etc/hostapd/
- Terminal# chown apache:wheel /etc/hostapd/hostapd.conf
- This will enable the webpage to access and make changes to "hostapd.conf"
- To verify if it works, enable bash login for user apache and adding apache into wheel group
- Terminal# usermod -aG wheel apache
- Verify by
- Terminal# cat /etc/group | grep apache
- Display : wheel:x:10:...,apache
- Terminal# chsh -s /bin/bash apache
- Verify by
- Terminal# cat /etc/passwd | grep apache
- OR
- Just edit the "/etc/passwd"
- Before => Display : apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin
- After => Display : apache:x:48:48:Apache:/usr/share/httpd:/bin/bash
- Terminal# su apache
- Then run any command that will write/read/execute the file in "/etc/hostapd"
Reference
- https://geekpeek.net/this-account-is-currently-not-available-login-problems/
- http://www.cyberciti.biz/faq/how-to-disable-shell-ftp-access-to-newuser/
- https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/2/html/Getting_Started_Guide/ch02s03.html
- http://www.cyberciti.biz/faq/how-to-use-chmod-and-chown-command/
No comments:
Post a Comment