mirror of
https://github.com/cbeuw/Cloak.git
synced 2026-04-25 12:35:59 +03:00
[GH-ISSUE #32] Where is config/ckserver.json ? #27
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Cloak#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @obvioususername on GitHub (Jun 17, 2019).
Original GitHub issue: https://github.com/cbeuw/Cloak/issues/32
I downloaded Ck-server-linux-amd64-1.1.1 on Ubuntu 18.04 and was trying to set the server up, but i couldn't find the ckserver.json file. Do i creat the json file locally or do i download it from somewhere or i'm just too dumb to find it lol ?
@cbeuw commented on GitHub (Jun 17, 2019):
Example configs can be found here: https://github.com/cbeuw/Cloak/tree/master/config
Note that you need to generate your own UID and key pairs
@obvioususername commented on GitHub (Jun 17, 2019):
Thanks , but i ran into a new problem that stopping SS-libev server with Cloak from starting.
It seems like the same problem as the Issue 13. i've read it, however after many attempt, i still failed to fix it.
The OS it runs on is Ubuntu 18.04
Here is the ckserver.json :
{
"WebServerAddr":"54.222.60.218:443",
"PrivateKey":"myprivatekey",
"AdminUID":"myUID",
"DatabasePath":"/root/Cloak/config/userinfo.db",
"BackupDirPath":"/root/Cloak/config/db-backup/userinfo.db"
}
And here is the SS-libev server config.json
{
"server":"myserver",
"server_port":443,
"local_port":1080,
"password":"mypassword",
"timeout":60,
"method":"chacha20-ietf-poly1305",
"plugin":"/root/Cloak",
"plugin_opts":"/root/Cloak/config/ckserver.json"
}
The ck-server file is located at /root/Cloak
I use systemtcl to start ss-server.
Here is some info from systemctl status:
Started Shadowsocks-libev Default Server Service.
ss-server[3657]: sh: 1: exec: /root/Cloak: Permission denied
ERROR: plugin service exit unexpectedly
INFO: plugin "/root/Cloak" enabled
INFO: UDP relay enabled
INFO: initializing ciphers... chacha20-ietf-po
@HirbodBehnam commented on GitHub (Jun 17, 2019):
Hello
As you can clearly see there is a permission problem. You can fix this by editing shadowsocks-libev.service file. To find out where the file is run
systemctl status shadowsocks-libev. Then for me (Centos 7) it says:You can see that my service file is in
/usr/lib/systemd/system/shadowsocks-libev.service. Open the file with your favorite editor. Then there are two line like this:Change them to
Then save and exit. Run
systemctl daemon-reloadand thensystemctl restart shadowsocks-libevand see if the problem is fixed or not.Also as mentioned in readme, I have written a small script to automatically install Shadowsocks with Cloak with just some clicks. You can try that if you like.
@obvioususername commented on GitHub (Jun 17, 2019):
Hello
I followed your suggestion but it didn't work on me. It still failed to start with permisson denied error.
@HirbodBehnam commented on GitHub (Jun 17, 2019):
Ok can you run
ss-serverfrom root user?Just type and execute
ss-server@HirbodBehnam commented on GitHub (Jun 17, 2019):
See looks like something is using 443 port.
Can you post the output of this?
netstat -ltnp | grep -w ':443'If
netstatis not installed try installing it byapt install net-toolsThis command shows what application is using the 443 port.
As an alternative way you can change the port of proxy to something else.
@obvioususername commented on GitHub (Jun 17, 2019):
Oh, my bad. I was running vanilla SS when i ran ss-server command, so the 443 port is occupied.
I stopped it and tried again with Cloak. Output's below :
INFO: plugin "/root/Cloak" enabled
INFO: initializing ciphers... chacha20-ietf-poly1305
INFO: tcp server listening at 127.0.0.1:45371
INFO: running from root user
sh: 1: exec: /root/Cloak: Permission denied
ERROR: plugin service exit unexpectedly
(I omitted dates and time stamp)
@HirbodBehnam commented on GitHub (Jun 17, 2019):
I'm not sure about this but you can try:
chmod -R 777 /root/CloakThis command makes /root/Cloak folder and it's subfiles world accessible.
As an alternative method you can try moving /root/Cloak folder somewhere that is global accessible.
@obvioususername commented on GitHub (Jun 17, 2019):
I tried but still same result unfortunately. :(
@HirbodBehnam commented on GitHub (Jun 17, 2019):
Ok can you use this script to install the Shadowsocks with Cloak?
Please before using the script uninstall shadowsocks with cloak.
@cbeuw commented on GitHub (Jun 17, 2019):
Don't put anything under /root. That's the home directory of the root user and you will run into permission problems for almost everything. Ideally you should put Cloak under your own home directory, that's /home/[your user name]
@obvioususername commented on GitHub (Jun 18, 2019):
I did that and the SS server with cloak started, but when i edited the SS windows client's server info, i clicked "OK", then i got some error pops out(which i forgot to save those texts). When i went to the SS server side, i see errors like these :
ERROR: block all requests from A.B.C.D(the IP of my local PC)
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
ERROR: block all requests from A.B.C.D
Then i restarted SS-server with Cloak , there is permisson denied problem again :
sh: 1: exec: /home/peiper/cloak: Permission denied
ERROR: plugin service exit unexpectedly
INFO: plugin "/home/peiper/cloak" enabled
INFO: UDP relay enabled
INFO: initializing ciphers... chacha20-ietf-pol
INFO: tcp server listening at 127.0.0.1:44027
INFO: udp server listening at A.B.C.D:443
@cbeuw commented on GitHub (Jun 18, 2019):
Try
chmod +x /home/peiper/cloak?@obvioususername commented on GitHub (Jun 18, 2019):
Not working, same error. :(
@obvioususername commented on GitHub (Jun 18, 2019):
Is there something wrong with the path in my ckserver.json ?
{
"WebServerAddr":"54.222.60.218:443",
"PrivateKey":"myprivatekey",
"AdminUID":"myUID",
"DatabasePath":"/home/peiper/cloak/userinfo.db",
"BackupDirPath":"/home/peiper/cloak"
}
@cbeuw commented on GitHub (Jun 18, 2019):
What is
/home/peiper/cloak? Is it a directory or is it an executable? If it's a directory then it can't be executed. You need to setpluginto the executable file of ck-server. If it's an executable then you can't do/home/peiper/cloak/userinfo.db@obvioususername commented on GitHub (Jun 18, 2019):
/home/peiper/cloak is a directory that contains the ck-server file and ckserver.json.
I redo the
pluginfield in the SS-server's config.json , but it still failed to start. Got error like this :Configuration file error: Attempting to open database: open /home/peiper/cloak/userinfo.db: permission denied
These are the plugin and plugin_opts filed in ss-server's config.json :
"plugin":"/home/peiper/cloak/ck-server-linux-amd64-1.1.1",
"plugin_opts":"/home/peiper/cloak/ckserver.json"
@cbeuw commented on GitHub (Jun 18, 2019):
Delete userinfo.db and let Cloak create one itself again. It may have been created with root privilege and doesn't let cloak write
@obvioususername commented on GitHub (Jun 18, 2019):
I ran
find / userinfo.db, but the output is "No such file or directory"@obvioususername commented on GitHub (Jun 18, 2019):
Well, i created the
/peiperdirectory under/homewhit root identity expecting to avoid the permisson problem, but it seems not working. May be it's because i'm logged in as root ? Should i make a new user to try again ?@cbeuw commented on GitHub (Jun 18, 2019):
Urghhh... Why did you manually create a directory under /home? The users' home folders should have be automatically created when you create a user.
In almost all situations you shouldn't log in as root. Didn't the system prompt you to create a user when you installed Ubuntu? Regardless if you don't have a user other than root, you should create one and never log in as root again. If you need superuser privilege, use sudo.
@obvioususername commented on GitHub (Jun 18, 2019):
What a fool i am. lol
Anyway, i created and logged in as a new sudo user
peiper, then did it all over again, but unfortunately there is still permisson denied error like before in systemctl status. Besides when i runss-serverthere is output like this indicates something wrong with the private key :INFO: plugin "/home/peiper/cloak/ck-server-linux-amd64-1.1.1" enabled INFO: initializing ciphers... chacha20-ietf-poly1305 INFO: tcp server listening at 127.0.0.1:53031 ck-server.go:254: Configuration file error: Failed to decode private key: illegal base64 data at input byte 32 ERROR: plugin service exit unexpectedly@cbeuw commented on GitHub (Jun 19, 2019):
Make sure to include the = paddings at the end when copying base64 strings. They are necessary.
@obvioususername commented on GitHub (Jun 20, 2019):
Hi
I generated new keys and UID then set up again, it worked ! The proxy speed skyrocketed.
But there is still a problem that it can not be start by systemctl which will get permission denied to userinfo.db error. Using
ss-serverworks perfectly but once i exit SSH terminal, it's dead.I'm sorry to be annoying, is there any possible solution ?
@obvioususername commented on GitHub (Jun 20, 2019):
Oh wait, it seems
ss-serverkeeps working after i log out my server, does it keeps running in background by default ? Should i do something like putnohup &on that command to make sure it runs after exitting terminal ?@HirbodBehnam commented on GitHub (Jun 20, 2019):
Hello
You have two options.
Use
tmuxorscreen. These applications make the process run in background even if the SSH connection is closed.I personally sometimes use
tmux. Just install it via your package manager and then typetmuxin terminal. Then typess-server. You will see that the ss-server starts running. PressCtrl+Band then pressD. The session will be detached and you can safely close the SSH connection. However if you reboot your server you have to do it again.Use a service.
If you want systemctl service you can try this:
At first type
nano /etc/systemd/system/shadowsocks-server.service. This will open the nano editor. Then paste this inside it:Note: You may change some values in this file like User and Group or even WorkingDirectory.
After you saved this, type
systemctl daemon-reloadand thensystemctl start shadowsocks-serverandsystemctl enable shadowsocks-server@obvioususername commented on GitHub (Jun 20, 2019):
Thanks for the help !
@HirbodBehnam commented on GitHub (Jun 20, 2019):
You're welcome :)