Fixes in change_password for users, disabled password change
This commit is contained in:
parent
8e693ae7b6
commit
e4410d0421
3 changed files with 25 additions and 2 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
from pastafariutils.unix import add_user, del_user, change_password
|
#from pastafariutils.unix import add_user, del_user, change_password
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from subprocess import call, DEVNULL
|
from subprocess import call, DEVNULL
|
||||||
import json
|
import json
|
||||||
|
|
@ -23,6 +23,7 @@ parser.add_argument('--ssh_pub_key_file', help='The ssh pub key of the unix user
|
||||||
|
|
||||||
args=parser.parse_args()
|
args=parser.parse_args()
|
||||||
|
|
||||||
|
"""
|
||||||
if args.password:
|
if args.password:
|
||||||
|
|
||||||
password_user=args.password
|
password_user=args.password
|
||||||
|
|
@ -35,7 +36,7 @@ if args.password:
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print('Changed password succesfully...\n')
|
print('Changed password succesfully...\n')
|
||||||
|
"""
|
||||||
|
|
||||||
if args.ssh_pub_key_file:
|
if args.ssh_pub_key_file:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,27 @@ if linux_distro=='arch':
|
||||||
print('Error, cannot add utilities for archlinux')
|
print('Error, cannot add utilities for archlinux')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
# Add selinux permisions
|
||||||
|
|
||||||
|
if call("sudo getenforce", shell=True)==0:
|
||||||
|
|
||||||
|
# If selinux enabled, set permissions to /home/hosting/sites for sites.
|
||||||
|
if call("setenforce 0", shell=True) > 0:
|
||||||
|
print('Error, cannot disable selinux...')
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
#with open('/etc/sysconfig/selinux') as f:
|
||||||
|
|
||||||
|
if linux_distro=='rocky' or linux_distro=='fedora' or linux_distro=='almalinux':
|
||||||
|
|
||||||
|
if call("sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config", shell=True) > 0:
|
||||||
|
print('Error, cannot disable selinux in file /etc/selinux/config...')
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
if call("sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux", shell=True) > 0:
|
||||||
|
print('Error, cannot disable selinux in file /etc/sysconfig/selinux...')
|
||||||
|
exit(1)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
<p><label>${lang('pastafari2', 'ssh_port', 'SSH port')}* <span class="pastafari2_error error" id="ssh_port_error"></span></label> <input type="number" name="ssh_port" value="22"></p>
|
<p><label>${lang('pastafari2', 'ssh_port', 'SSH port')}* <span class="pastafari2_error error" id="ssh_port_error"></span></label> <input type="number" name="ssh_port" value="22"></p>
|
||||||
<p><input type="submit" value="${lang('pastafari2', 'send', 'Send')}"/></p>
|
<p><input type="submit" value="${lang('pastafari2', 'send', 'Send')}"/></p>
|
||||||
</form>
|
</form>
|
||||||
|
<p><strong class="error">${lang('pastafari2', 'if_fedora_derivatives', 'Warning: if you use Fedora based distros, WE PUT selinux in permissive mode.')}</strong></p>
|
||||||
</div>
|
</div>
|
||||||
<p><a href="${url_for('.pastafari2_dashboard')}">Servers</a> >> ${lang('pastafari2', 'add_server', 'Add server')}</p>
|
<p><a href="${url_for('.pastafari2_dashboard')}">Servers</a> >> ${lang('pastafari2', 'add_server', 'Add server')}</p>
|
||||||
<script type="text/javascript" src="${make_media_url('js/jsutils/posting2.js', 'pastafari2')}"></script>
|
<script type="text/javascript" src="${make_media_url('js/jsutils/posting2.js', 'pastafari2')}"></script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue