Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section Scripting / API
  • Search

Demo Account Setup

Questions regarding the API
Application Programming Interface
Locked
  • Print view
Advanced search
7 posts • Page 1 of 1
inerd
Posts: 21
Joined: Sun Dec 29, 2013 3:14 am
Contact:
Contact inerd
Website

Demo Account Setup

Post by inerd » Thu Aug 14, 2014 7:42 am

This lil cron will change your demo account password every minute so people can access it anytime without manually changing the password. I have a working example below. Works on CentOS but dont know about Ubuntu or Debian

How to: (Please setup up a demo account for this to work)

1.) Login into VestaCP using your admin account
2.) Go to the Cron section
3.) Click on Add Cron Job
4.) Enter the following data:

Minute: */1
Hour: *
Day: *
Month: *
Day of Week: *
Command: sudo /usr/local/vesta/bin/v-change-user-password demo demo123

5.) Then save the cron and see the magic :)


A Working Example:

Control Panel Login:
https://vps.flectsoft.co.uk:8083/

Username: demo
Password: demo123

Change the password to anything, anytime of the day then within 1 minute it will change back within 1 minute due to a cron setup
Top

hafeezksa
Posts: 81
Joined: Mon Apr 27, 2015 5:45 pm
Contact:
Contact hafeezksa
Website

Re: Demo Account Setup

Post by hafeezksa » Sat May 02, 2015 9:12 am

There is error as below: (centos 6)

Cron: sudo /usr/local/vesta/bin/v-change-user-password demo demo123

"/usr/local/vesta/bin/v-change-user-password: line 17: /func/main.sh: No such file or directory
/usr/local/vesta/bin/v-change-user-password: line 18: /conf/vesta.conf: No such file or directory
/usr/local/vesta/bin/v-change-user-password: line 29: check_args: command not found
/usr/local/vesta/bin/v-change-user-password: line 30: validate_format: command not found
/usr/local/vesta/bin/v-change-user-password: line 31: is_object_valid: command not found
/usr/local/vesta/bin/v-change-user-password: line 32: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-change-user-password: line 49: gen_password: command not found
/usr/local/vesta/bin/v-change-user-password: line 49: update_user_value: command not found
/usr/local/vesta/bin/v-change-user-password: line 50: update_user_value: command not found
/usr/local/vesta/bin/v-change-user-password: line 53: log_history: command not found
/usr/local/vesta/bin/v-change-user-password: line 54: log_event: command not found"
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Demo Account Setup

Post by skurudo » Tue May 05, 2015 1:36 pm

hafeezksa wrote:There is error as below: (centos 6)

Cron: sudo /usr/local/vesta/bin/v-change-user-password demo demo123
Check sudoers and user there (can he sudo or not)
Top

hafeezksa
Posts: 81
Joined: Mon Apr 27, 2015 5:45 pm
Contact:
Contact hafeezksa
Website

Re: Demo Account Setup

Post by hafeezksa » Wed May 06, 2015 4:40 pm

Yes, this command is working manually using sudo but using vesta cron I received above error in my email from system.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Demo Account Setup

Post by skurudo » Wed May 06, 2015 5:16 pm

Code: Select all

export VESTA=/usr/local/vesta/;sudo /usr/local/vesta/bin/v-change-user-password demo demo123
Try this command
Top

hafeezksa
Posts: 81
Joined: Mon Apr 27, 2015 5:45 pm
Contact:
Contact hafeezksa
Website

Re: Demo Account Setup

Post by hafeezksa » Wed May 06, 2015 5:33 pm

skurudo wrote:

Code: Select all

export VESTA=/usr/local/vesta/;sudo /usr/local/vesta/bin/v-change-user-password demo demo123
Try this command
Thanks, It is working without any problem.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Demo Account Setup

Post by skurudo » Wed May 06, 2015 6:11 pm

hafeezksa wrote: Thanks, It is working without any problem.
Ok, it's good to hear.
Top


Locked
  • Print view

7 posts • Page 1 of 1

Return to “Scripting / API”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password