Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^9: [OT] A New Everything ?

by afoken (Chancellor)
on Sep 22, 2020 at 19:07 UTC ( [id://11122093]=note: print w/replies, xml ) Need Help??


in reply to Re^8: [OT] A New Everything ?
in thread [OT] A New Everything ?

I thought the point here was that I was to log out as root and back in as fred. I get nothing that way:

root@third:~# exit logout Connection to 143.110.153.42 closed. $ ssh fred@143.110.153.42 fred@143.110.153.42: Permission denied (publickey). $

It seems fred lacks his public key in the file ~fred/.ssh/authorized_keys. You need to upload that before blocking password logins, e.g. using ssh-copy-id, add add it to the autorhized_keys file. Once that is set up, you should be able to log in using the public key.

Is that as easy as

rm /usr/bin/su

Yes and no. It does remove su, but you are supposed to uninstall the entire package, e.g. using apt-get remove package-name on Debian-based distributions. The package name depends on the distribution. On Ubuntu, it's in util-linux, and you really don't want to uninstall that package. Just leave su as is. It won't hurt for now.

After the useradd, I go in, and there's nothing in home. That doesn't make sense to me.

Home is supposed to be empty, or a copy of /etc/skel/. How should the operating system know what you want to put there?

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^10: [OT] A New Everything ?
by marto (Cardinal) on Sep 23, 2020 at 10:11 UTC

    "Home is supposed to be empty, or a copy of /etc/skel/. How should the operating system know what you want to put there?"

    Aldebaran is telling you that /home/fred does not exist.

    marto@Marto-Desktop:~$ sudo useradd fred [sudo] password for marto: Sorry, try again. [sudo] password for marto: marto@Marto-Desktop:~$ sudo passwd fred New password: Retype new password: passwd: password updated successfully marto@Marto-Desktop:~$ ls -al /home total 12 drwxr-xr-x 3 root root 4096 May 12 15:05 . drwxr-xr-x 20 root root 4096 May 12 15:04 .. drwxr-xr-x 56 marto marto 4096 Sep 23 10:32 marto marto@Marto-Desktop:~$ su - fred Password: su: warning: cannot change directory to /home/fred: No such file or di +rectory $ ^C

    As previously stated useradd was not being called with the correct arguments to create /home/fred, which would have been useradd -m fred thus creating the directory and copying the files from /etc/skel.

      Aldebaran is telling you that /home/fred does not exist.

      You are right, I misread that part.

      Update: I misread "home" as $ENV{HOME} instead of /home, and I used "home" in my previous answer to mean $ENV{HOME}, not /home.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        Aldebaran is telling you that /home/fred does not exist.

        That did throw me for my first of many "what the heck" moments. I soon created barney with the right command. I misunderstood a good handful of things in trying to get barney's ssh squared away, so I moved on to wilma. I needed to have directories and files set with proper ownership, e.g. wilma needs to own .ssh . One thing I was reading wrong was that I thought authorized_keys was a directory that contained files. Not so.

        We're getting deep down into the weeds of this thread, and I've gotten a lot of great help on a nebulus and moving target, but we get fewer eyes down here, and I don't want to punish the people who are helping me by keeping it going forever. I'm close with wilma and I think I'm gonna get over on betty. Here's my latest attempt with wilma:

        Thanks all for comments.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-03-28 16:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found