How to access Virtualmin if ssh loging root with ssh RSA public private key

This is how to create Webmin user via console in Linux:

  1. Create a new user for Webmin called admin with password 123:
    echo admin:\$1\$84720675\$F08uAAcIMcN8lZNg9D74p1:::::1584720675:::0:::: >> /etc/webmin/miniserv.users
    
  2. Add permissions to all modules for admin user:
    echo "admin: backup-config change-user webmincron usermin webminlog webmin help servers acl bacula-backup init passwd quota mount fsdump inittab jailkit ldap-client ldap-useradmin logrotate mailcap mon pam certmgr proc at cron sentry package-updates software man syslog syslog-ng system-status useradmin security-updates apache bind8 pserver dhcpd dhcp-dns dovecot exim fetchmail foobar frox jabber ldap-server majordomo htpasswd-file minecraft mysql openslp postfix postgresql proftpd procmail qmailadmin mailboxes sshd samba sendmail spam squid sarg wuftpd webalizer link adsl-client bandwidth fail2ban firewalld ipsec krb5 firewall firewall6 exports exports-nfs4 nis net xinetd inetd pap ppp-client pptp-client pptp-server stunnel shorewall shorewall6 itsecur-firewall tcpwrappers idmapd filter burner grub lilo raid lvm fdisk lpadmin smart-status time vgetty iscsi-client iscsi-server iscsi-tgtd iscsi-target cluster-passwd cluster-copy cluster-cron cluster-shell cluster-shutdown cluster-software cluster-usermin cluster-useradmin cluster-webmin cfengine heartbeat shell custom disk-usage export-test ftelnet filemin flashterm tunnel file phpini php-pear cpan htaccess-htpasswd ruby-gems telnet ssh ssh2 shellinabox status ajaxterm updown vnc dfsadmin ipfilter ipfw smf bsdexports bsdfdisk format hpuxexports rbac sgiexports zones dnsadmin" >> /etc/webmin/webmin.acl
    
  3. Change password to the secure one for admin user:
    webmin passwd admin
    
    Note: You might need to change libexec to share on Debian systems!
  4. Restart Webmin with the following command:
    /etc/webmin/restart
    
  5. Login with newly created user and password.
1 Like