LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Issue to set it up (https://www.linuxquestions.org/questions/linux-software-2/issue-to-set-it-up-4175655549/)

Huamin 06-12-2019 12:26 AM

Issue to set it up
 
Hi,
I used the below commands to create SFTP user
sudo adduser edfiles

sudo mkdir -p /var/sftp/uploads
sudo chown root:root /var/sftp
sudo chmod 755 /var/sftp
sudo chown edfiles:edfiles /var/sftp/uploads

how to ensure that I would be able to folder like uploads, when I access SFTP, which is

sftp://113.255.213.124/

eklavya 06-12-2019 04:40 AM

You are giving 755 permissions to directory sftp, it means other users can read and execute the files of directory sftp. They can not write into it.
If you open directory /var/sftp/uploads by log into user edfiles, you can still see the content of parent directory /var/sftp, but you can not write into it as directory does not have write permission for groups and others.

If you loginto the directory uploads by user edfiles using protocol sftp, you can use ssh command
ssh edfiles@113.255.213.124
It will log into home directory of edfiles, now you can open directory /var/sftp/uploads using command cd

I hope port 22 is opened for given IP

Huamin 06-12-2019 05:20 AM

Yes, port 22 is open and what to check next, below (as I've got Permission denied). (IP is little bit different from the one originally mentioned)

[root@CentOS65x64 huamin]# ssh edfiles@113.255.219.215
Address 113.255.219.215 maps to 215-219-255-113-on-nets.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
edfiles@113.255.219.215's password:
Permission denied, please try again.
edfiles@113.255.219.215's password:

eklavya 06-12-2019 05:33 AM

Accept the request, it will add an entry in ~/.ssh/known_hosts file.

After creating user I hope you have set password for the user using passwd command.
Now it should ask password. After successful login, you will land into home directory of logged in user.
Now you can use cd to go into your desirable directory.

TB0ne 06-12-2019 07:09 AM

Quote:

Originally Posted by eklavya (Post 6004375)
Accept the request, it will add an entry in ~/.ssh/known_hosts file.

After creating user I hope you have set password for the user using passwd command.
Now it should ask password. After successful login, you will land into home directory of logged in user.
Now you can use cd to go into your desirable directory.

Good luck, eklavya. This is a follow-up from the OP's other thread:
https://www.linuxquestions.org/quest...tp-4175654907/

They're trying to just set up a user for anonymous uploads via SFTP. They were told explicitly to set up the user with no shell access, and that they'd have to chroot SFTP. They apparently haven't done anything except to add a generic user account.

And Huamin, your question of "how to ensure that I would be able to folder like uploads, when I access SFTP, which is", seems pointless. Mainly because you could have just tried to upload a file and seen for yourself what the results were, quicker than you could have posted this. And again, if you cannot set up a user account correctly, don't know the basics of folder permissions, and can't/won't do any basic research about messages, you really should let your administrator set things up.

eklavya 06-12-2019 07:37 AM

Quote:

Originally Posted by TB0ne (Post 6004425)
Good luck, eklavya. This is a follow-up from the OP's other thread:
https://www.linuxquestions.org/quest...tp-4175654907/

They're trying to just set up a user for anonymous uploads via SFTP. They were told explicitly to set up the user with no shell access, and that they'd have to chroot SFTP. They apparently haven't done anything except to add a generic user account.

Oh, I was just verifying still if I remember some basic points or not. Got a chance to open LQ today, so I tried to start with easiest question I found.
No false advice should be given by me, that was my only concern. If OP is not following the solution given by other senior members, it may be ok but returning here after long time, I should not provide any wrong solution.
Well I should try my luck on easier questions.:)

TB0ne 06-12-2019 07:48 AM

Quote:

Originally Posted by eklavya (Post 6004441)
Oh, I was just verifying still if I remember some basic points or not. Got a chance to open LQ today, so I tried to start with easiest question I found.
No false advice should be given by me, that was my only concern. If OP is not following the solution given by other senior members, it may be ok but returning here after long time, I should not provide any wrong solution.
Well I should try my luck on easier questions. :)

No, your advice was spot on and 100% correct...just consider the OP's posting history and use caution.

They didn't tell you that their actual goal was to create an anonymous user, with no password (per their other thread), nor did they give you any other bits of information that the put in their other thread about this same issue.

scasey 06-12-2019 08:43 AM

Quote:

Originally Posted by Huamin (Post 6004304)
Hi,
I used the below commands to create SFTP user
sudo adduser edfiles

sudo mkdir -p /var/sftp/uploads
sudo chown root:root /var/sftp
sudo chmod 755 /var/sftp
sudo chown edfiles:edfiles /var/sftp/uploads

how to ensure that I would be able to folder like uploads, when I access SFTP, which is

sftp://113.255.213.124/

Guess I'll give this another try (instead of reporting this thread as a duplicate, which it kind of is)
Huamin: You must answer these questions to get any further help!
What is the home directory of the edfiles user?
What are the permissions on that directory?
What password did you assign to the user edfiles? Where did you do that? (You don't show doing that here)
[You don't need to tell us the password, but can you answer that question to yourself?]

TB0ne 06-13-2019 07:56 AM

Quote:

Originally Posted by scasey (Post 6004466)
Guess I'll give this another try (instead of reporting this thread as a duplicate, which it kind of is)
Huamin: You must answer these questions to get any further help!
What is the home directory of the edfiles user?
What are the permissions on that directory?
What password did you assign to the user edfiles? Where did you do that? (You don't show doing that here)
[You don't need to tell us the password, but can you answer that question to yourself?]

And also, we don't see where the OP has chroot'ed SFTP, or set the user up to have no shell. Both of which were told to them in their other thread as well. I can't imagine having an SSH user with no password, with shell access, that isn't chroot'ed. But, not my system.

Huamin 06-13-2019 09:02 PM

Quote:

Originally Posted by scasey (Post 6004466)
Guess I'll give this another try (instead of reporting this thread as a duplicate, which it kind of is)
Huamin: You must answer these questions to get any further help!
What is the home directory of the edfiles user?
What are the permissions on that directory?
What password did you assign to the user edfiles? Where did you do that? (You don't show doing that here)
[You don't need to tell us the password, but can you answer that question to yourself?]

Scasey,
Home path of "edfiles" is /home/edfiles.

Here is permission of the path.

[huamin@CentOS65x64 home]$ ls -l
total 36
drwx------ 25 edfiles edfiles 4096 Jun 13 18:25 edfiles

EKLavya,
After having created the user, how to make use of it, when accessing SFTP?

scasey 06-13-2019 11:03 PM

Quote:

Originally Posted by Huamin (Post 6005066)
Scasey,
Home path of "edfiles" is /home/edfiles.

Here is permission of the path.

[huamin@CentOS65x64 home]$ ls -l
total 36
drwx------ 25 edfiles edfiles 4096 Jun 13 18:25 edfiles

EKLavya,
After having created the user, how to make use of it, when accessing SFTP?

That all looks right, so how are you connecting with sftp? Are you on a Linux client machine at the terminal?
What command are you entering and what response are you getting?

Huamin 06-14-2019 01:54 AM

When getting into
sftp://113.255.213.124/

I expect to have control to the path like to have proper user account having write permission.

scasey 06-14-2019 02:11 AM

Quote:

Originally Posted by Huamin (Post 6005097)
When getting into
sftp://113.255.213.124/

I expect to have control to the path like to have proper user account having write permission.

Yup. Not an answer to the questions I asked. So again:

how are you connecting with sftp?
Are you on a Linux client machine at the terminal?
What command are you entering and what response are you getting?

Huamin 06-14-2019 02:31 AM

I used one other Windows machine to access

sftp://113.255.213.124/

I can get into it but I expect to have proper control by user account and to have also write permission to it. You can try now and you should be able to get into it.

scasey 06-14-2019 02:37 AM

Quote:

Originally Posted by Huamin (Post 6005103)
I used one other Windows machine to access

sftp://113.255.213.124/

I can get into it but I expect to have proper control by user account and to have also write permission to it. You can try now and you should be able to get into it.

<sigh>
how are you connecting with sftp?
Are you on a Linux client machine at the terminal? ... I"m guessing that's a no...it's a yes or no question. Why can't you answer it?
What command are you entering and what response are you getting?

Where are you entering that? In a browser? In Windows Explorer? <sigh>


All times are GMT -5. The time now is 10:33 PM.