LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-15-2009, 05:07 AM   #1
acute123
LQ Newbie
 
Registered: Dec 2004
Posts: 22

Rep: Reputation: 15
Lightbulb uploading ssh public using web browser from Debian Linux


Hi Everyone

I want to upload my SSH public key on a website using my web browser(this is the only available option).

My public key is present in /root/.ssh/id_rsa.pub

When i try to upload this from my web browser i have to give a path but i cannot see id_rsa.pub when i browse. Although i have enabled "show hidden files" option. That is why i can see .ssh folder but i cannot see files within .ssh using my web browser.

Any quick response is really appreciated.

Regards
 
Old 01-15-2009, 05:19 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
First of all, /root/.ssh/id_rsa.pub isn't your public key. It is the public key of the root user. Your public key is in ~/.ssh/id_rsa.pub. You may not have created one using the "ssh-keygen" program.

You shouldn't be able to browse inside the /root directory at all because you don't have permission to enter the /root directory, let alone the /root/.ssh/ directory.
 
Old 01-15-2009, 05:33 AM   #3
acute123
LQ Newbie
 
Registered: Dec 2004
Posts: 22

Original Poster
Rep: Reputation: 15
Hi
Thank You for your reply.

I generated key using keygen program ssh-keygen. When i did that i was a root user having taken root priviledges by using su.

Keys are there. But when i try to upload via my browser i can reach upto .ssh because i have enabled "show hidden files". Otherwise i would not have been able to see .ssh in the root folder(/root/.ssh).

But the problem is that even after doing so i cannot see any files in /root/.ssh when accessed through web browser.

I can see them from terminal.

Regards
 
Old 01-16-2009, 07:38 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Never run a web browser as a root user. What public key do you want to publish? The host key or your own key. Is this to run an automated job on a remote computer via cron? Why does root on your computer need to log into a remote computer.

If this is for automated cron backup or syncing with a server you have on the web, then you would use host keys. The obvious solution is to temporarily copy your computers host public key to your home directory (use the -a option to preserve permissions), and then run your browser as a normal user.

I'm guessing that this is for a remove web app to administer a web server or something similar. If this key is to gain access manually, then use your regular users key. Locally you can log in running as a regular user, even if you are logging into a remote account. If you haven't run "ssh-keygen" as your regular user, then do so.

This is similar to logging into mysql, using "mysql -u root -p". You shouldn't run the mysql client as root simply because you are logging into the root account.

Also, when you said that you could see /root/.ssh in the terminal, did you su to root first or use sudo? If so, you would see the contents, but if you could see the contents of /root as a regular user, you need to fix the permissions of /root and /root/.ssh/. Ssh will reject connections if the permissions are bad.

Last edited by jschiwal; 01-16-2009 at 07:52 PM.
 
Old 01-17-2009, 10:58 AM   #5
acute123
LQ Newbie
 
Registered: Dec 2004
Posts: 22

Original Poster
Rep: Reputation: 15
Hi
Thank you for your reply. I generated public key as an ordinary user and then i was able to upload it using my web browser because now the key was in user's folder not in the root's folder.

Thank you once again for your reply.

Regards
 
Old 01-19-2009, 07:00 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Good Luck!
 
  


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
ssh with x-server through web browser xc1024 Linux - Software 6 01-05-2009 02:48 PM
Web browser that works over SSH ??? FireRaven Linux - Software 6 12-31-2006 10:11 AM
public web browser aka web kiosk xmnemonic Linux - Software 6 06-14-2004 03:20 PM
Uploading web pages; get "access forbidden" when I load them in browser! Thermodynamic Linux - Software 1 04-03-2004 05:52 PM

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

All times are GMT -5. The time now is 10:15 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
Open Source Consulting | Domain Registration