Results 1 to 10 of 10

Thread: OpenSSH + Putty Problem

  1. #1
    Join Date
    Jun 2008
    Beans
    4

    Angry OpenSSH + Putty Problem

    Aye guys

    Fairly new to Linux... Came across a problem.

    I've installed Ubuntu 8.04 to 10GB HDD that I'll later insert into another machine 'cause most of the I/O ports are dead. (Dont ask)

    So here's my dilemma... I've installed OpenSSH...

    And using my brothers computer(WinXP) + Putty... I successfully connected via open ssh...

    But it asks me for a password...

    I'm logging in as root... and i don't have a password set for root.

    I'm pretty sure that i have allowed root login.

    But i have also used my other account that was created during setup... black rabbit... However, it could be me, but im almost certain i have the correct password.

    It just doesn't let me log in... it just says...

    'Access Denied'

    Any help or ideas would be greatly appreciated.

    Keep in mind that I'm still really newbie when it comes to cli.

    Thanks guys... Looked everywhere and couldn't find what i was looking for.

    Ciao!
    Black Rabbit

  2. #2
    Join Date
    Sep 2006
    Beans
    66
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: OpenSSH + Putty Problem

    It has been a while since I set up SSH on my system but I think you have to run a command to generate your ssh key for the users you want to have access. Glancing through the SSH howto it doesn't look like that is necessary any more

    here is the link to that howto

    https://help.ubuntu.com/community/SSHHowto

    As for root Ubuntu disables root logins by default and really there is no need to enable them

    the sudo command works just fine for a few commands and if you need to do many commands a

    Code:
    sudo -i
    will get you to a root command line

    Hope this helps

    dlehman

  3. #3
    Join Date
    Jan 2008
    Location
    Cambridge MA
    Beans
    1,163
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: OpenSSH + Putty Problem

    The easiest way would be to ssh using your username, then you can gain root access by using the following command:
    Code:
    sudo -s
    Its the ubuntu way of doing
    Code:
    su
    and you don't need the root password, just your password (if your account has been allowed to administer the system)

    ps.

    I'm no expert on sudo, but a bunch of ubuntu guys chewed me out in IRC for not using:
    Code:
    sudo -s
    for going root, apparently most of the other ways of going root, sudo bash, sudo su, sudo -i, don't handle things as well...
    Allons-y Alonzo! - The Dr.
    Is that what Time Lords do? Lop a bit off, and grow another one. You're like worms! - Donna Noble
    The world is a mess... and I just need to... Rule it. - Dr. Horrible

  4. #4
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: OpenSSH + Putty Problem

    /me chews neurostu out

    Code:
    sudo -i


    @BlackRabbit89 :

    The basic syntax is :

    Code:
    ssh user@server
    Enter the user's password, then if needed sudo -i

    If you want to log in as root you will need to set a root password.

    If you forgot your user name/password :

    boot the broken machine to recovery mode.

    List user names :

    Code:
    ls /home
    Set a password

    Code:
    passwd user
    where "user" is a user in /home
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  5. #5
    Join Date
    Jun 2008
    Beans
    4

    Unhappy Re: OpenSSH + Putty Problem

    Hmm... Well I looked at the HowTo again... And as im on medication that impairs my ability to absorb information... Its difficult. [Yeah, I'm pretty much at a 2 yo's level atm]

    This key gen encryption... is there anyway i could just bugger that off?

    Hell i dont even care if it has a password or anything... Its just a playground linux server. And i just need to remote connect to it.

    If not, how do i go about creating a user and giving it a key... ive read that you need to give the key to the remote pc... but im using a winXP putty... where would i put the key?

    Sorry for the hassle guys.

    EDIT: Ah k thanks for that... Ill try that when i get the next chance. Ill post back with the results.
    Last edited by BlackRabbit89; June 18th, 2008 at 05:48 AM. Reason: delay in browser.

  6. #6
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: OpenSSH + Putty Problem

    You do not need a key, making a key will only make things one step more complex.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #7
    Join Date
    Jun 2006
    Location
    Switzerland
    Beans
    Hidden!
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: OpenSSH + Putty Problem

    a key can be used to create auto-logins so that no passwords are needed. I have this setup to rsync backups between multiple machines.

  8. #8
    Join Date
    Jan 2008
    Location
    Cambridge MA
    Beans
    1,163
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: OpenSSH + Putty Problem

    Quote Originally Posted by bodhi.zazen View Post
    /me chews neurostu out

    Code:
    sudo -i
    So what is the difference between -i and -s for sudo?
    Allons-y Alonzo! - The Dr.
    Is that what Time Lords do? Lop a bit off, and grow another one. You're like worms! - Donna Noble
    The world is a mess... and I just need to... Rule it. - Dr. Horrible

  9. #9
    Join Date
    Sep 2006
    Beans
    66
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: OpenSSH + Putty Problem

    I apologize for all the confusion with the key, I just remember having to do that at one time, but reading through everything now you don't need a key.

    As said before
    1. fire up putty and connect to your box
    2. login with the regular user account and password
    3.
    Code:
    sudo -i
    will get you root access and use your user account password

    This assumes that the regular user as rights to administer, which you should because it is the account created during install correct?

    Again sorry about the confusion with the key.

  10. #10
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: OpenSSH + Putty Problem

    Quote Originally Posted by neurostu View Post
    So what is the difference between -i and -s for sudo?
    Both give root access. sudo -s uses your user environmental variables -i uses root's.

    Try it yourself :

    Code:
    sudo -s
    
    echo $HOME
    
    exit
    And then

    Code:
    sudo -i
    
    echo $HOME
    The problem with sudo -s is root will user your $HOME (and alises and other environmental variables) rather then /root (as home or root's environmental variables.). This can be problematic as any files written in $HOME will then be owned by root and will result in conflicts (try starting a shell (bash) in $HOME/.bashrc is owned by root).

    There *may* be times when you would want to sudo -s (ie use your user's alilses and $HOME), but in general you should put any alises for root in /root/.bashrc and use /root as home when running as root.

    See man sudo
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •