LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training 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 05-29-2009, 09:29 AM   #1
shanecaldeiro
LQ Newbie
 
Registered: May 2009
Posts: 24

Rep: Reputation: 15
entering without root password


I am using ubuntu and the testing server is fedora I would like to ssh it from a client system without asking a root password. How?
 
Old 05-29-2009, 09:34 AM   #2
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 43
ssh keys

http://www.linuxquestions.org/linux/...ation_with_ssh
 
Old 05-29-2009, 10:09 AM   #3
shanecaldeiro
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ncsuapex View Post
Copy the public key to the server (you will need to enter the password):
cat ~/.ssh/id_dsa.pub | ssh user@server "cat - >> ~/.ssh/authorized_keys"

please explain
 
Old 05-29-2009, 10:17 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

What is unclear? The link given explains it all pretty good.

One other thing: You are talking about the root password. Most distro's configure ssh so to not allow root to use ssh (which is a good thing!!). Is the password actually asked or are you not able to use ssh as root user?
 
Old 05-29-2009, 10:18 AM   #5
ermoreno
LQ Newbie
 
Registered: May 2009
Location: San Antonio, Texas
Distribution: AIX, RHEL
Posts: 8

Rep: Reputation: 0
put /etc/ssh/ssh_host_rsa_key.pub from the remote server in the authorized_keys file on the local host. Then ssh with the -i switch and the path for the identity file. As long as the permissions are correct for .ssh and the underlying files are correct and the PermitRootLogin line of sshd_config is set to yes you should be good.

ssh -i /etc/ssh/ssh_host_rsa_key root@remotehost
 
Old 05-29-2009, 10:28 AM   #6
shanecaldeiro
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by druuna View Post
Hi,

What is unclear? The link given explains it all pretty good.

One other thing: You are talking about the root password. Most distro's configure ssh so to not allow root to use ssh (which is a good thing!!). Is the password actually asked or are you not able to use ssh as root user?
Actually i am new to linux. I have ran ssh-keygen -t dsa but cant understand what to do after that.

if i run
cat ~/.ssh/id_dsa.pub | ssh user@server "cat - >> ~/.ssh/authorized_keys"

the error is
cat: /home/shane/.ssh/id_dsa.pub: No such file or directory
root@192.168.129.108's password:
 
Old 05-29-2009, 10:41 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

The ssh-keygen command (if done correctly) should have created some files in your ~/.ssh directory......

What shows up when you do the following: ls -la ~/.ssh/
 
Old 05-29-2009, 10:43 AM   #8
shanecaldeiro
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by druuna View Post
Hi,

The ssh-keygen command (if done correctly) should have created some files in your ~/.ssh directory......

What shows up when you do the following: ls -la ~/.ssh/
total 12
drwx------ 2 shane shane 4096 2009-05-29 19:04 .
drwxr-xr-x 36 shane shane 4096 2009-05-29 20:02 ..
-rw-r--r-- 1 shane shane 442 2009-05-29 19:04 known_hosts
 
Old 05-29-2009, 10:52 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

The ssh-keygen command wasn't executed correctly (or you gave the wrong input).

Code:
cd ~/.ssh
ssh-keygen -t dsa

Enter file in which to save the key (/home/user/.ssh/id_dsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user/.ssh/id_dsa.
Your public key has been saved in /home/user/.ssh/id_dsa.pub.
The key fingerprint is:
5c:2c:a0:4b:5c:83:31:9f:26:b1:41:8b:f0:6f:5e:99 user@exile
After you start the ssh-keygen -t dsa command you do not have to enter anything, just press enter/return until the normal prompt returns.

If all goes well there should be (at least) 2 files in your .ssh directory: id_dsa and id_dsa.pub

Hope this helps.
 
  


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
Tntrepid does not allow entering any password jdtiede Ubuntu 1 01-18-2009 11:18 PM
How Can I Start Synaptic Without Entering A Password? taurusx5 Linux - Software 2 10-02-2008 02:22 AM
Entering Password with a Space via CLI username132 Linux - Software 2 04-01-2006 10:57 PM
Bash scripting: entering a password sibtay Programming 1 12-28-2005 12:12 AM
Running a script as root with sudo without entering the user password kloss Linux - General 8 10-10-2005 12:39 PM


All times are GMT -5. The time now is 05:20 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