Create New User With SFTP Access

12 posts / 0 new
Last post
#1 Wed, 06/30/2010 - 09:15

Create New User With SFTP Access

Virtualmin>Edit Mail and FTP Users>Add a user to this server OR Add a website FTP access user

Is it possible to create a new user with SFTP access?

Or grant it to an existing user?

Wed, 06/30/2010 - 11:30
ronald's picture

yes you have to change the shell to /bin/sh instead of /bin/false

Wed, 06/30/2010 - 12:34 (Reply to #2)

Ok thank you!

I found this to help me out a little:

...but I'm still a bit lost??? I guess its in a config file but can you give me a little direction please?

Mon, 07/05/2010 - 10:42 (Reply to #3)

"yes you have to change the shell to /bin/sh instead of /bin/false"

This gives the user access to read only, how can I get write access?

Wed, 06/30/2010 - 15:42
ronald's picture

so in webmin - system - Users and groups; click the user you want to change. In this Edit User field, find shell and change it to /bin/sh

for new users you can change it in the Server Templates - Administration User - Initial Unix shell and choose the shell from the dropdown - Email, FTP and SSH.
If that option isn't there change it under Virtualmin - System Customization - Custom Shells so it will show up in the server template.

Mon, 07/05/2010 - 10:42 (Reply to #5)

This time instead of editing an existing user already part of a virtual server in webmin>system>users and groups, I created a new one.

The goal is to create a new user that is similar to the root user that can sftp into all VS's. After creating the new user and copying settings from the root user (webmin>system>users and groups), the new user still does not have permission to sftp into VM's.

I made the new users primary group "root" and secondary groups the same as root, "adm", "bin", "daemon", "disk", "root", "sys" and "wheel".

With these settings the same I would expect the new user to function the same as root but permission is denied when trying to access the VM's by sftp.

No doubt I am probably in the wrong area. If this is even possible please can you point me in the right direction?

Sun, 07/04/2010 - 15:49

After playing around with creating users and groups (webmin>system>users and groups) I cleaned out all the users that I added. Now when I try to add a new user again under a VS, I get this error:

Failed to save mailbox : A Subversion user with the same name already exists

I checked the subversion config files in the etc folder and found the user that I deleted through webmin (system>users and groups) still listed in these files.

Now I find under webmin>webmin users, this guy is still listed lol.

How can I get rid of him completely from on convenient location? :)

or do I have to manually delete from every possible place? If so what are all the possible places that a user created under a VS can exist?

Mon, 07/05/2010 - 00:38

Ok I have recovered from the mess!

  1. I added a user in webmin>system>users and groups and changed the shell to bin/sh
  2. For that user I moved accross all the domains I wanted to give access to in "secondary groups".

The user can connect sftp and view all the files and folders in those domains but when trying to add files or create new folders, filzilla reports permission denied.

How can I grant permission to modify the contents please?

Really I would like to create a group of admins that can modify all vs's. I've been playing around with webmin system users and groups for 1 day now and it really doesent make any sense. It seems kind of pointless to give sftp access to only view the files, need help please?

Mon, 07/05/2010 - 01:12

I think it might be buggy because this has happened twice...

All my accounts can no longer connects sftp. This is hapeneing when adding and deleting users and groups in webmin users, webmin system>users and groups, and virtualmin add ftp user. The root account is also getting authentication failures too and I have not been anywhere near the root settings.

The first time I was pretty sure it wasn't me but I had my doubts. Now its happened for a second time and I am positive this is a bug.

I have a backup so its all good but I still need help here!

Mon, 07/05/2010 - 08:47


So you can log in as root via Virtualmin, but not using SFTP?

First off, what distro are you using? We'll want to use the logs to help figure some of this out, though which log to use depends on your distro.

Also, what shell does root have at the moment?

Can you log in as root using SSH?

That should get us started :-)


Mon, 07/05/2010 - 10:20 (Reply to #10)

CentOS 5.4 Root bin/bash

"So you can log in as root via Virtualmin, but not using SFTP?"

Yes that was the case after adding/deleting user created by me in webmin>Users, webmin>system>users and groups and virtualman>Edit Mail and FTP Users.

I didn't touch any other existing users including root and this happened 2 times.

I'm afraid there is no data because I had to revert to a back up to move on. If it happens again I will gladly get the logs for you. If you tell me now what you would need then I will send them to if it happens again.

Right now I can SSH/SFTP as root, as domain owner, as additional user created in webmin>users and groups.

What I can't do is give that newly created user permission to add files to th public_html folder for the domain.

I logged in as domain owner changed the file permissions to 770, made the user a member of the group in webmin>groups and Users. The user still cannot write to that folder.

Surely this cannot be so difficult!!!!!!!!! please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

My best guess is that I need to create a unix group with permission to the vm's but where/how to do this in webmin/virtualmin, I don't know. please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mon, 07/05/2010 - 10:39

Tried this way:

  1. Virtualmin>Manage Extra Admins - Added user with every option yes/checked. - Still no SFTP access

  2. Checked webmin to give user a bin/sh shell - user doesn't show in webmin to change shell

Topic locked