LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-12-2014, 04:50 PM   #1
AmirSI
LQ Newbie
 
Registered: Mar 2014
Posts: 13

Rep: Reputation: Disabled
Thread Options Mount SFTP to Ubuntu Server


I have SFTP and i would like to mount it as folder on my Ubuntu server.
The problem is i need to login whit Username/Password and .ppk key (public and private key).
Does anyone have any idea, how can this be done?
 
Old 03-13-2014, 08:49 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Copy your system's public key file (.pub file inside ~/.ssh) and save it on the ubuntu server in the directory ~/.ssh as authorized_keys.
Now when you will try to log in to server, it will not ask username and password.
 
Old 03-13-2014, 09:25 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,941

Rep: Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825
Welcome to LinuxQuestions.

Regardless of password/keys you already have the capability to connect to a remote server via sftp in the desktop places menu. If you want to mount a remote file system via sftp/ssh then you need to install sshfs.

https://help.ubuntu.com/community/SSHFS
 
1 members found this post helpful.
Old 03-13-2014, 09:40 AM   #4
AmirSI
LQ Newbie
 
Registered: Mar 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks for your support.
I used sshfs and its working.

I first step i have generate new keys using puttygen. I created openssh-private and public key from my ".ppk" file(i have recived .ppk file from my sftp hosting company).

Public Key:
puttygen keyfile.ppk -o id_rsa.pub -O public-openssh

Private Key:
puttygen keyfile.ppk -o id_rsa -O private-openssh

Then i used sshfs to mount it:

sshfs -o ssh_command="ssh -i /home/key/folder" user@server.si:/backup ~/mnt/where/to/open

/home/key/folder => folder where they keys are saved
user@server.si:/backup =>Username, Host and folder which i need to mount
~/mnt/where/to/open = folder on local pc
 
Old 03-14-2014, 06:27 AM   #5
AmirSI
LQ Newbie
 
Registered: Mar 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Is it possible to mount, this sftp permanent, using sshfs?
 
Old 03-14-2014, 06:30 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,941

Rep: Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825
The provided link shows how to add a line entry to the /etc/fstab file.
 
Old 03-14-2014, 06:42 AM   #7
AmirSI
LQ Newbie
 
Registered: Mar 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
It doesn't show where to add ssh key and i need to write password. Can i damage /etc/fstab file whit wrong command.

I was thinking to try whit:
sshfs#Username@backup.backme.si:/backup/ /home/administrator/mnt/Arctur-Git-Server/ fuse auto,_netdev,port=22,user,allow_other,noatime,follow_symlinks,IdentityFile=/home/administrator/ice/,reconnect 0 0

Last edited by AmirSI; 03-14-2014 at 06:52 AM.
 
Old 03-14-2014, 06:55 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,941

Rep: Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825
The best method would be to use keys.
Yes, if you mess up fstab file it could cause the system not to boot.
 
Old 03-14-2014, 08:07 AM   #9
AmirSI
LQ Newbie
 
Registered: Mar 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
I tryed to use this:

sshfs#AmirSi@backup.si:/backup/ /home/administrator/mnt/test/ fuse auto,_netdev,port=22,user,allow_other,noatime,follow_symlinks,IdentityFile=/home/administrator/.ssh/id_rsa,reconnect 0 0

But it dosnt work...

When i mount it manualy;
sshfs AmirSI@backup.si:/backup ~/mnt/test/

i need to write down the password:
Enter passphrase for key '/home/administrator/.ssh/id_rsa':

Where in automount i need to add this password.

Last edited by AmirSI; 03-14-2014 at 09:08 AM.
 
Old 03-14-2014, 08:14 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,941

Rep: Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825
I do not think there is a method if using a passphrase.
 
Old 03-14-2014, 08:19 AM   #11
AmirSI
LQ Newbie
 
Registered: Mar 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Is it possible to remove it from the key?
 
Old 03-14-2014, 08:23 AM   #12
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,135

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
when creating a key and it prompts you for a passphrase (which is different from a password) just hit enter twice which effectively creates an empty passphrase.
 
Old 03-14-2014, 08:26 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,941

Rep: Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825Reputation: 1825
Yes
http://www.cyberciti.biz/faq/howto-s...ng-passphrase/
 
1 members found this post helpful.
  


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
SFTP Issue with Ubuntu 12 server durgaprasath Linux - Server 1 02-10-2014 04:44 AM
HOW TO: Unmounting a NFS mount on a server when the mounted server has gone down, causing the applications thread to hang up. rahulk LinuxAnswers Discussion 3 06-21-2013 10:25 AM
FTP/SFTP write access denied on Ubuntu Server prudens Linux - Newbie 1 07-18-2009 10:50 AM
invalid mount options message on ubuntu gutsy cdrom0 larryfroot Linux - Desktop 2 04-16-2008 04:53 AM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:58 AM.

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