Home Page › Forums › Network Management › ZeroShell › Logging in to zeroshell’s ssh as a user (not admin) › Reply To: Logging in to zeroshell’s ssh as a user (not admin)
editing the files in zeroshell needs to be done via ssh, so
– run ‘ssh admin@’
– it asks for a passwd, so go ahead with it
– then press ‘s’ (for ‘s’hell), after a password it should drop you into a shell
– edit /etc/passwd; the only editor I found installed by default on zeroshell is vi/vim, so ‘vim /etc/passwd’ (read something about editing in vim beforehand, if you haven’t done it before)
– copy the first line (begins with root:x: ), so that you have it twice and edit one of them. you need to change the first thing before ‘:’ to the actual username you want to use, and then you might want to change the default directory (with root it’s “/root”) to something else (like “/home/”) [then you need to create this directory, run ‘mkdir /home/’ in shell]; save the file, exit the editor
– edit /etc/ssh/sshd_config, so ‘vim /etc/ssh/sshd_config’. Find the line that with “AllowUsers admin” and change it to “AllowUsers admin “. Save the file, exit the editor. It is important that you don’t mess up this file, since if it’s faulty then sshd won’t restart properly and you won’t be able to ssh to your machine.
– restart the ssh daemon. This is best done from gui, so finish the ssh session (‘exit’ on the shell prompt exits to the menu, and then ‘ctrl+c’ exits the session). Go to your zeroshell gui, click on ‘SSH’, uncheck “Enabled”, click “Save”, check “Enabled”, click “Save”. This restarts the ssh daemon.
– now if you’ve added the user properly to kerberos’ database (in gui, click on “Users”, etc…), you should be able to ‘ssh @’ and after entering the password, you should be in (a shell prompt).
– if it doesn’t work, check your ssh logs (in gui, click “Logs”, then select “sshd”)
– WARNING: these changes are not persistent, so after rebooting the zeroshell, you need to do them again (I haven’t looked into this, so I don’t know now how to make them persistent).
– you don’t need any extra things for sftp, it’s set up on by default. So if your ssh login as a user works, just use any sftp client to connect to zeroshell. You can use ‘sftp @’, or ‘scp @:’