LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-12-2019, 12:26 AM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
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/
 
Old 06-12-2019, 04:40 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 633

Rep: Reputation: 141Reputation: 141
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
 
1 members found this post helpful.
Old 06-12-2019, 05:20 AM   #3
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
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:

Last edited by Huamin; 06-12-2019 at 05:33 AM.
 
Old 06-12-2019, 05:33 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 633

Rep: Reputation: 141Reputation: 141
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.

Last edited by eklavya; 06-12-2019 at 05:38 AM.
 
2 members found this post helpful.
Old 06-12-2019, 07:09 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,579

Rep: Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682
Quote:
Originally Posted by eklavya View Post
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.
 
Old 06-12-2019, 07:37 AM   #6
eklavya
Member
 
Registered: Mar 2013
Posts: 633

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by TB0ne View Post
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.
 
1 members found this post helpful.
Old 06-12-2019, 07:48 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,579

Rep: Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682
Quote:
Originally Posted by eklavya View Post
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.
 
2 members found this post helpful.
Old 06-12-2019, 08:43 AM   #8
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,291

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
Quote:
Originally Posted by Huamin View Post
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?]
 
5 members found this post helpful.
Old 06-13-2019, 07:56 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,579

Rep: Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682
Quote:
Originally Posted by scasey View Post
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.
 
1 members found this post helpful.
Old 06-13-2019, 09:02 PM   #10
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by scasey View Post
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?

Last edited by Huamin; 06-13-2019 at 09:11 PM.
 
Old 06-13-2019, 11:03 PM   #11
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,291

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
Quote:
Originally Posted by Huamin View Post
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?
 
Old 06-14-2019, 01:54 AM   #12
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
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.
 
Old 06-14-2019, 02:11 AM   #13
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,291

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
Quote:
Originally Posted by Huamin View Post
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?

Last edited by scasey; 06-14-2019 at 02:12 AM.
 
Old 06-14-2019, 02:31 AM   #14
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
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.
 
Old 06-14-2019, 02:37 AM   #15
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,291

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
Quote:
Originally Posted by Huamin View Post
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>
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lm10.0 gateway is set but when I reboot I have to set the gateway rharvey32 Mandriva 8 02-13-2006 01:35 PM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
xfree86 set to 0. It should be set to -10. jimsac Linux - Newbie 0 05-22-2004 06:08 AM
How to view set-user-ID and set-group-ID Xris718 Linux - General 7 01-10-2004 01:44 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration