Register
It is currently Mon Sep 01, 2014 5:27 pm

Ssh_connect.sh


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Fri Dec 11, 2009 11:42 am   

Joined: Fri Dec 11, 2009 11:27 am
Posts: 3
Im pretty new to shell scripting so excuse my newbness. Anyways, Im basically trying to get my script to seek out the username from whoami (usernames on the server will be the same as a persons login name for their pc) and use that to connect to ssh (with encryption keys). This way I won't have to modify the script for every computer illiterate friend of mine that I give server access to.

Code:
 
1 #!/bin/bash
2 #bash script to connect to Mephisto file server with encrpyption keys
3 username="/usr/bin/whoami"
4
5 sshfs -p 234 $username@malluen.no-ip.org:/mnt/storage ~/storage
6
7 fi

*Pay no attention to the numbers- they are simply from numbered lines in vim =)


Top
 Profile  
 PostPosted: Fri Dec 11, 2009 2:59 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 535
Code:
sshfs -p 234 $USER@malluen.no-ip.org:/mnt/storage ~/storage
should do the trick, yes?


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP