I'm trying to create an sshkey to send to a vendor so they can connect to their chrooted jailed folder: /home/jail/home/ The folder setup and permissions are all set to that specific user, lets say "user1" user1:user1
Whenever I create a key with ssh-keygen, it always lists the root user at the bottom of the .pub as root@system. I don't want the vendor connecting as root, rather have them connect as user1 so they only have access to their chrooted directory. The user accounts do not have login creds as I only want them to login with sshkeys so they can sftp their data to the drop folder.
I can't create the key on the user1 account as its privileges are very minimal and they can't even run ssh-keygen. Everything else I'm trying just set it to root@system since that's the account I'm logged in as. This has to be a common practice but I can't figure this out. I was assuming that I would put the .pub of the pair in the chrooted authorized_hosts file and then securely send them the private key to use to connect via SFTP and drop off their files.
Everything works properly if I try to sftp using: sftp -i file user1@dropserver.server.com. However, I can also just do sftp -i file ROOT@dropserver.server.com and it lets me in there with root permissions. I just need to stop the vendor from being able to just use root as the username and bypass the chroot.