› Forums › Network Management › ZeroShell › Howto: Use WinSCP with ZeroShell
- This topic is empty.
-
AuthorPosts
-
August 15, 2010 at 12:23 pm #42591
adem0x
MemberHere 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 viAugust 18, 2010 at 1:26 am #50936ppalias
MemberCommand is correct. Maybe you need to add it in a postboot script to make it available on next reboot.
August 18, 2010 at 5:21 am #50937adem0x
MemberI would have thought ‘/etc/passwd’ file’s contents would be session-persistent.
Isn’t it so?
August 18, 2010 at 9:28 am #50938ppalias
MemberContents 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.
August 18, 2010 at 4:47 pm #50939serangku
Memberthanks …
i should try this for update L7 pattern …
mr. fulvio, can this L7 auto update in next release … 🙂
September 14, 2010 at 9:03 pm #50940marti vielha
MemberHi, 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. -
AuthorPosts
- You must be logged in to reply to this topic.