How to add/create standard root user for ssh access.

Permissions, Users, Uear groups, shared folders, LDAP/domain
Locked
User avatar
BorizzK
Posts: 13
Joined: 01 Sep 2023, 18:21

How to add/create standard root user for ssh access.

Post by BorizzK »

I need root user in tos linux for remoge access from other device with ssh certificate-based authentication for remotely shutdown/restart tnas
I created a root user with the necessary privileges (via ssh), but tos resets root in sshd_config when the sshd service is restarted.
How to do it?
Thanx
User avatar
BorizzK
Posts: 13
Joined: 01 Sep 2023, 18:21

Re: How to add/create standard root user for ssh access.

Post by BorizzK »

Problem solved

go to /etc/init.d

i change file ssh_service

string 19

from
sed -i "/AllowUsers/cAllowUsers $admin" /etc/ssh/sshd_config

to
sed -i "/AllowUsers/cAllowUsers $admin root" /etc/ssh/sshd_config

restart service and problem solved
User avatar
BorizzK
Posts: 13
Joined: 01 Sep 2023, 18:21

Re: How to add/create standard root user for ssh access.

Post by BorizzK »

But cert authenticartion from device to tnas not works
Always need password....
How to do it with tnas???
P.S. From device to esxi's hosts working perfectly
User avatar
BorizzK
Posts: 13
Joined: 01 Sep 2023, 18:21

Re: How to add/create standard root user for ssh access.

Post by BorizzK »

Problem solved

Create user root (login to ssh with adm acc, useradd root ... , passwd root ...)
Edit /etc/passwd (root:x:0:0:Root User,:/root:/bin/bash)
Edit /etc/group (admin:x:3:admin,youradmin,root)
Edit /etc/ssh/sshd_config :
uncomment string HostKey /etc/ssh/ssh_host_rsa_key
uncomment string (if commented out) AuthorizedKeysFile /etc/ssh/authorized_keys
add strings
RSAAuthentication yes
PubkeyAuthentication yes
also i add string - Protocol 2
and uncomment and change string - UseDNS no
5. Edit /etc/init.d/ssh_service
change string - sed -i "/AllowUsers/cAllowUsers $admin" /etc/ssh/sshd_config to sed -i "/AllowUsers/cAllowUsers $admin root" /etc/ssh/sshd_config
or comment out the condition
#if [ ! -z "$admin" ]; then
# sed -i "/AllowUsers/cAllowUsers $admin" /etc/ssh/sshd_config
#fi
and change string
AllowUsers youradmin to AllowUsers youradmin root

restart tnas

now user root and /etc/ssh/authorized_keys is work
Locked

Return to “Privileges”