Backup forum

A place to discuss Backup software and online services

You are not signed in.

Announcement

Signed in and can't post? Click here!Hot Tags: account Android Archive cleanup Code42 CrashPlan Backup bug bugs cleanup CcrPU Delete desktop error fail failed failure feature request idevsutil iDrive community incremental internet issue linux log login mac Mobile password performance progress QNAP REST restore Security slow speed suggestions support sync Synology upgrade upload windows backblaze carbonite SugarSync Dropbox Veeam Memopal Netgear Asustor Pro Softnet Corporation Raghu Kulkarni
  • Index
  •  » Common Room
  •  » Is there a script for automating login during bootup, for Linux users? RSS Feed

#1 2021-02-07 19:04:32

Zeke
On hiatus
From: San Francisco
Registered: 2020-07-24
Posts: 44
Website

Is there a script for automating login during bootup, for Linux users?

I'd love to be able to automatically login to IDrive, whenever I boot up. Second best option would be to create a script that will log me in automatically, that I can run AFTER booting up, that is: without having to type in my username, password, and encryption key. I'm the only one using this computer, so security issues are zilch. Thanks!


Brindlekin Tales (or "Flaco & Lucky: a Tale of 2 Doggies")
https://zekeblog.wordpress.com/brindlekin-tales/

Offline

 

#2 2021-02-07 19:47:00

SteveA
Administrator
Registered: 2018-02-23
Posts: 406
Website

Re: Is there a script for automating login during bootup, for Linux users?

I don't use these scripts myself, but I've had a look at them and I noticed in account_setting.pl there are input statements for Usermame, Password and Encryption key.

# Get user name and validate
    my $uname = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'username', ': '], "username", 1);
    $uname = lc($uname); #Important
    my $emailID = $uname;

    # Get password and validate
    my $upasswd = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'password', ': '], "password", 0);

Couldn't you just modify these lines to assign your details directly?

# Get user name and validate
    #my $uname = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'username', ': '], "username", 1);
        my $uname = "zeke";
    $uname = lc($uname); #Important
    my $emailID = $uname;

    # Get password and validate
    #my $upasswd = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'password', ': '], "password", 0);
        my $upasswd = "ZekePW123";

Offline

 

#3 2021-02-07 23:11:07

Zeke
On hiatus
From: San Francisco
Registered: 2020-07-24
Posts: 44
Website

Re: Is there a script for automating login during bootup, for Linux users?

Well, I tried that, but it seems to hiccup over using the "at" symbol, as my username is my email address. And I don't know how to get around that. Here's the result:

zeke@X230:~/IDriveForLinux/scripts$ ./account_setting-AUTO.pl
"my" variable $uname masks earlier declaration in same scope at ./account_setting-AUTO.pl line 119.
Possible unintended interpolation of @sonic in string at ./account_setting-AUTO.pl line 119.
"my" variable $upasswd masks earlier declaration in same scope at ./account_setting-AUTO.pl line 125.
Global symbol "@sonic" requires explicit package name (did you forget to declare "my @sonic"?) at ./account_setting-AUTO.pl line 119.
Execution of ./account_setting-AUTO.pl aborted due to compilation errors.

Or it's something else, I really have no idea, I'm not a programmer in ANY language, including Perl. At any rate, wouldn't it be the "login.pl" file I'd need to edit?

Last edited by Zeke (2021-02-07 23:14:48)


Brindlekin Tales (or "Flaco & Lucky: a Tale of 2 Doggies")
https://zekeblog.wordpress.com/brindlekin-tales/

Offline

 

#4 2021-02-08 01:06:18

SteveA
Administrator
Registered: 2018-02-23
Posts: 406
Website

Re: Is there a script for automating login during bootup, for Linux users?

Did you put a # in front of the existing input statements?

#my $uname = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'username', ': '], "username", 1);
#my $upasswd = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'password', ': '], "password", 0);

Regarding the @ symbol, apparently Perl tries to interpret it, so you need to escape it, for example:

my $uname = "zeke\@domain.com";

I'm not familiar with Perl either, we live and learn!

As to whether you should be doing this in login.pl - may be!

Offline

 

#5 2021-02-08 01:12:13

SteveA
Administrator
Registered: 2018-02-23
Posts: 406
Website

Re: Is there a script for automating login during bootup, for Linux users?

Further to my comment about login.pl - yes, maybe copy it to a new file called loginauto.pl and modify it so that the username, password and encryption key are assigned automatically.

Offline

 

#6 2021-02-08 03:29:53

Zeke
On hiatus
From: San Francisco
Registered: 2020-07-24
Posts: 44
Website

Re: Is there a script for automating login during bootup, for Linux users?

SteveA wrote:

Did you put a # in front of the existing input statements?

No, because those statements I changed directly...I didn't copy and paste them to duplicate, then comment out the original statement.

#my $uname = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'username', ': '], "username", 1);
#my $upasswd = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'password', ': '], "password", 0);

I have no idea where to type in my username and password. Maybe between those paired but empty quote marks? Or replace double-quoted "username" and "password" at the end there?

[Regarding the @ symbol, apparently Perl tries to interpret it, so you need to escape it, for example:

my $uname = "zeke\@domain.com";

Okay, got it, thanks.

I'm not familiar with Perl either, we live and learn!

As I like to say: "I couldn't hack my way out of a virtual paper bag!" big_smile

As to whether you should be doing this in login.pl - may be!

I think it's fine to change the filename...however, I can always stick to the original, after first backing it up as "login-ORIGINAL.pl". I just need to figure out where to type in the username and password...as well as the encryption key! Thanks!

Maybe I'll send a query on this to IDrive support, about creating an automated script. They just asked me to run "send_error_report.pl" and include the ticket number before sending it off to them. This is about finding out why my backup stopped at 18%.

As for your theory that it does not resume from where you left off...IIRC in Windows it DID resume at the percentage point from where I stopped. Anyway, let's see what they have to say.

Last edited by Zeke (2021-02-08 03:40:58)


Brindlekin Tales (or "Flaco & Lucky: a Tale of 2 Doggies")
https://zekeblog.wordpress.com/brindlekin-tales/

Offline

 

#7 2021-02-08 12:22:10

SteveA
Administrator
Registered: 2018-02-23
Posts: 406
Website

Re: Is there a script for automating login during bootup, for Linux users?

Zeke wrote:

SteveA wrote:

Did you put a # in front of the existing input statements?

No, because those statements I changed directly...I didn't copy and paste them to duplicate, then comment out the original statement.

#my $uname = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'username', ': '], "username", 1);
#my $upasswd = Common::getAndValidate(['enter_your', " ", $AppConfig::appType, " ", 'password', ': '], "password", 0);

I have no idea where to type in my username and password. Maybe between those paired but empty quote marks? Or replace double-quoted "username" and "password" at the end there?


Regarding the @ symbol, apparently Perl tries to interpret it, so you need to escape it, for example:

my $uname = "zeke\@domain.com";

Okay, got it, thanks.

What I meant was, you get rid of the whole line containing "getAndValidate" (by commenting it out) and add a new line with just my my $uname = "zeke\@domain.com"

getAndValidate is a function that takes keyboard input and assigns it to the variable $uname, but we want to just hard-code it.

Zeke wrote:

As to whether you should be doing this in login.pl - may be!

I think it's fine to change the filename...however, I can always stick to the original, after first backing it up as "login-ORIGINAL.pl". I just need to figure out where to type in the username and password...as well as the encryption key! Thanks!


my $encKey = Common::getAndValidate(["\n", 'enter_your', " encryption key: "], "private_key", 0);

appears many times in login.pl and account_settings.pl so I'm not sure which one you would change - potentially all of them, but it may be that the scripts are designed to handle a number of accounts so it may be a bit more complicated.

Zeke wrote:

Maybe I'll send a query on this to IDrive support, about creating an automated script. They just asked me to run "send_error_report.pl" and include the ticket number before sending it off to them.

See if you can get in contact with Anil Kumar who wrote those scripts. He's on LinkedIn.

I wonder if there's a simpler way to hack these scripts and bypass login - after all, they have already stored your authentication details so that they can run unattended  backups from the cron jobs.

Offline

 

#8 2021-02-08 18:42:02

Zeke
On hiatus
From: San Francisco
Registered: 2020-07-24
Posts: 44
Website

Re: Is there a script for automating login during bootup, for Linux users?

Wow, such excellent suggestions...thanks immensely. I WILL contact Mr. Kumar on this, shortly. Will report back. But I JUST found something interesting:

I rebooted Linux, and then ran the IDrive script, login.pl...and it says I'm already logged in! Hmm. But I rebooted early this morning, when my monitor was blank, and it wouldn't turn back on. I don't use sleep or hibernation mode, but DO have the system set to turn the screen blank after ten minutes of no activity. Usually, once I tap a key or do a mouse click, the screen turns back on. But I've found that it sometimes fails to do that after leaving the system inactive overnight. So, that forced shutdown (by keeping the power button pressed), may have something to do with my still being logged on to IDrive...by possibly restoring my current online activities before the shutdown.

Egads...just one thing after another...you can't make this stuff up!

Last edited by Zeke (2021-02-08 18:59:40)


Brindlekin Tales (or "Flaco & Lucky: a Tale of 2 Doggies")
https://zekeblog.wordpress.com/brindlekin-tales/

Offline

 
  • Index
  •  » Common Room
  •  » Is there a script for automating login during bootup, for Linux users? RSS Feed

Board footer

Protect your brand, users & email deliverability. Let’s Encrypt- free, automated, and open certificate authority (CA) StatusCake Monitoring Service Stop Forum Spam

Powered by © Copyright 2002–2005 Rickard Andersson
SteveA's forums are free for everyone to use, however if you would like to contribute to the upkeep I would be grateful for any donation!