LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2011, 11:06 PM   #1
pikohn
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Rep: Reputation: 0
Question Automating the SSH Login Process.


Hello all Linux Gurus,


I am trying to make a batch script that will automatically setup up an SSH Tunnel so that I may filter my web traffic. I'm a little paranoid about putting my password in a plain text file. Is there another way to automate the process so all I would have to do is double click a script to start the tunnel?

It's late so if you need clarification just ask.

Thanks to all that reply.

Mike
 
Old 10-15-2011, 11:09 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Use key based authentication instead of passwords. If you Google for "ssh key based authentication" or similar, you should find a number of sites telling you how to do it. You'll need to use ssh-keygen to generate your keys.
 
Old 10-16-2011, 04:11 AM   #3
vasile002
Member
 
Registered: Oct 2011
Posts: 51

Rep: Reputation: Disabled
Here's how to use rsa key auth
http://news.softpedia.com/news/How-t...on-38599.shtml
 
Old 10-16-2011, 12:23 PM   #4
pikohn
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
is there any way write a script that will enter a pass phrase, but somehow encrypt it so prying eyes can't figure it out?
 
Old 10-17-2011, 12:12 PM   #5
vasile002
Member
 
Registered: Oct 2011
Posts: 51

Rep: Reputation: Disabled
well you could write the script in C and compile it into a binary, that should provide some protection
 
Old 10-17-2011, 12:15 PM   #6
MANOHARNLINUX
LQ Newbie
 
Registered: Oct 2011
Posts: 9

Rep: Reputation: Disabled
You can also try 'expect' script. Using which you can automate ssh login process.
No need to configure any ssh key authentication. Password change doesn't effect unless you maintain right password to be passed during expect script trigger.

You can also try tcl/tk program.
 
Old 10-17-2011, 12:58 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by pikohn
is there any way write a script that will enter a pass phrase, but somehow encrypt it so prying eyes can't figure it out?
If you encrypt the passphrase, you have to keep the encryption key somewhere, right?

As mentioned, expect(1) is an option (but it requires a password in clear text). Another option is pubkey authentication + ssh-agent(1).

---

After reading some of the other replies:

Yes, you could lock this away in a compiled binary and set appropriate file permissions. That should discourage the majority of (certainly not all) folks.

Last edited by anomie; 10-17-2011 at 01:02 PM.
 
Old 10-17-2011, 08:42 PM   #8
pikohn
LQ Newbie
 
Registered: Sep 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks again for helping me out with this...SSH agent seems like a winner.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
automating the process of asking question jamesbon Programming 7 03-10-2011 11:00 AM
Automating Log Deletion process? your_shadow03 Linux - Newbie 1 02-25-2010 12:21 AM
shell script ssh: how to eliminate the login process output figo Programming 1 06-01-2009 02:05 PM
need help automating ssh-keygen linxq4u Linux - General 1 08-25-2007 11:13 AM
Automating the dial up process RecoilUK Linux - Networking 6 09-29-2001 01:35 PM


All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration