Howto: Use WinSCP with ZeroShell

Home Page Forums Network Management ZeroShell Howto: Use WinSCP with ZeroShell

This topic contains 4 replies, has 0 voices, and was last updated by  adem0x 8 years, 6 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #42591

    adem0x
    Member

    Here is what I did so that I could use WinSCP:

    Obviously, you need a copy of WinSCP and PuTTY installed in your computer.

    First, you use PuTTY to access ZeroShell in the console mode.
    — Enter IP address of ZeroShell.
    — Username: ‘admin
    — Password: ‘zeroshell
    Press ‘Open’ to connect

    [Or, you can do exactly the same in the ZeroShell box itself.]

    Once you have access to the console mode of ZeroShell, here is what you do:

    Press ‘S‘ to access the shell.

    Now, enter the following line (obviously, you will have to come up with your versions of ‘SomeUserName‘, ‘SomePassword‘)

    useradd -g root -s /bin/bash -p SomePassword -d /root SomeUserName

    This should have been enough, but for some reason it isn’t [I’ll be appreciative if someone corrects whatever was wrong with my useradd command above.]

    It is best to check that ‘/etc/passwd’ file has the following line exactly:

    make sure the line corresponding to ‘SomeUserName‘ is like below:

    SomeUserName:x:0:0:root:/root:/bin/bash

    SomeUserName:x:0:0:root:/root:/bin/bash

    if not, type the following and press ENTER

    vi /etc/passwd

    Then, alter that line to read exactly as that.

    Then, you need to alter ‘/etc/ssh/sshd_config’ file so that ‘SomeUserName’ is allowed to access remotely.

    Type the following line and press ENTER:

    vi /etc/ssh/sshd_config

    Find the following line

    AllowUsers admin
    and alter it to look like below:

    AllowUsers admin SomeUserName

    Save and exit.

    From then on, you can use WinSCP to connect and edit/alter/upload any file.



    Now, a very quick ‘vi’ course:

    To start editing press ‘i
    To end editing press ‘ESC

    To save the file
    press ‘ESC
    press SHIFT + ! {a few times}
    At the bottom you’ll see something like ‘:.!!!’
    Backspace until only ‘:‘ is left
    Type ‘w
    Press ENTER
    This will save the file but will not exit.

    To exit vi
    press ‘ESC
    press SHIFT + ! {a few times}
    At the bottom you’ll see something like ‘:.!!!’
    Backspace until only ‘:‘ is left
    Enter ‘q!
    Press ENTER
    This will exit vi

    #50936

    ppalias
    Member

    Command is correct. Maybe you need to add it in a postboot script to make it available on next reboot.

    #50937

    adem0x
    Member

    I would have thought ‘/etc/passwd’ file’s contents would be session-persistent.

    Isn’t it so?

    #50938

    ppalias
    Member

    Contents of everything in the ZS filesystem except “/Database” and “/DB” are set to default values after reboot. If you have manually done any change on them, you should also include this change in a preboot or postboot script. The easy solution is to copy the modified file in “/Database” and at the preboot script copy the file from “/Database” to the location you want it.

    #50939

    serangku
    Member

    thanks …

    i should try this for update L7 pattern …

    mr. fulvio, can this L7 auto update in next release … 🙂

    #50940

    marti vielha
    Member

    Hi, i have another solution:
    Acces to the shell with putty and enter chsh
    and enter /bin/bash
    you now can acces zeroshell with winscp, this is not persistent after reboot.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.