I can’t login via FTP app to my router

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
giuliomagnifico
DD-WRT User


Joined: 11 Apr 2016
Posts: 454
Location: Italy

PostPosted: Sat Sep 12, 2020 8:19    Post subject: I can’t login via FTP app to my router Reply with quote
Hello, since some months I have a trouble to login in to my R7800 via every FTP App, because I get this error:

“Subsystem request failed on channel 0”

I’m trying to fix it, I regenerated a new ssh key on my Mac, saved to the ssh keys under “services” in DD-WRT UI and now I can login without password from my Mac but I’m still unable to use any ftp app!

Someone have an idea on how to fix it?

Thanks!
Sponsor
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Sat Sep 12, 2020 12:57    Post subject: Reply with quote
The sftp subsystem is not installed/present on dd-wrt. Dropbear is only doing ssh.

the ftp server on ddwrt is only unencrypted ftp, via proftpd

so you would have to install via entware
giuliomagnifico
DD-WRT User


Joined: 11 Apr 2016
Posts: 454
Location: Italy

PostPosted: Sat Sep 12, 2020 13:46    Post subject: Reply with quote
Oh, damn, before I was using Kong's builds, for that I used to SFTP without problem! My mistake, I forgot it.

So, how can I access to my router in a simply way? SMB? I have to enable it somewhere?

Sorry for the silly question but I'm a bit disappointed now Very Happy thanks
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Sat Sep 12, 2020 16:30    Post subject: Reply with quote
Not sure what you mean by easy way.

You could enable:

On services->services
ssh
telnet

On services->Nas

ftp
Samba
giuliomagnifico
DD-WRT User


Joined: 11 Apr 2016
Posts: 454
Location: Italy

PostPosted: Sat Sep 12, 2020 22:39    Post subject: Reply with quote
Quote:
On services->Nas ftp


...it doesn't work: error 530 password incorrect

but is correct, I'm sure.
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Sun Sep 13, 2020 0:32    Post subject: Reply with quote
If I remember correctly it requires different user setup on that page, it is not the admin/root username and password.
giuliomagnifico
DD-WRT User


Joined: 11 Apr 2016
Posts: 454
Location: Italy

PostPosted: Sun Sep 13, 2020 10:17    Post subject: Reply with quote
Hmmm but there isn’t a field where write the user/pswd in the page. I tried to edit the password file with VI by writing the password and saved but it doesn’t work too. Damn, with Kong’s build were a lot easier: it just connel wet cts Very Happy

Maybe it’s more simple install SFTP with Optware, but if I install it once on the current build, I have to reinstall it every update?! Rolling Eyes
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Sun Sep 13, 2020 20:50    Post subject: Reply with quote
Under file sharing, there is an add user button. You click that and save, then enter user informatino save and apply.

The passwd file contains hashed passwords, so you would need to populate the correct hash, but be sure to populate the correct one (on my deployment the one that proftpd used is in a different location than the one regular one used).
giuliomagnifico
DD-WRT User


Joined: 11 Apr 2016
Posts: 454
Location: Italy

PostPosted: Sun Sep 13, 2020 21:05    Post subject: Reply with quote
Oh, what a stupid, I tried to add only the "share" and not the user (infact I was asking myself "where i have to put a username and password here?!" Laughing ) , now it works, thank you!
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Mon Sep 14, 2020 8:33    Post subject: Reply with quote
Wildlion wrote:
Under file sharing, there is an add user button. You click that and save, then enter user informatino save and apply.

The passwd file contains hashed passwords, so you would need to populate the correct hash, but be sure to populate the correct one (on my deployment the one that proftpd used is in a different location than the one regular one used).


Do you suggest to swap the hashed password for the initially entered plain text password for the user added under in File Sharing?

I found a passwd file here:
root@WZR-HP-G300NH:/# cat /tmp/etc/passwd
It contains a line for the added user (NAS_user in my case, with only Samba ticked), but nothing that looks like a password, hashed or not:
NAS_user:*:1000:1000:NAS_user:/var:/bin/false

The first two lines of this file concern root and reboot. They do contain what might be a hashed password; the same for both.

BTW:
the last line in this file concerns crontabs, but it contains what looks like a typo:
crontabs:*:0:0:Contab User,,,:/var:/bin/false

Do you have more explicit information on this password issue?
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Mon Sep 14, 2020 23:14    Post subject: Reply with quote
It might be easier if you read:

https://tldp.org/LDP/lame/LAME/linux-admin-made-easy/shadow-file-formats.html

and the wiki page is correct:
https://en.wikipedia.org/wiki/Passwd


a * or an x means that the password is being stored in a different file (the shadow file), I *think* if the shadow file is not present in this case then there is no password required.

for reference on the formats of the passwords:

https://en.wikipedia.org/wiki/Crypt_(C)

(PS. Yes I know providing refs instead of typing out, the linux man pages say the same thing)
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Sep 15, 2020 7:37    Post subject: Reply with quote
Wildlion wrote:

a * or an x means that the password is being stored in a different file (the shadow file), I *think* if the shadow file is not present in this case then there is no password required.


File tmp/etc/passwd doesn't contain the password for NAS_user, just an asterisk in its place. As I have set a password for this user and ticked samba access, the password must be stored elsewhere.
However, there is no /tmp/etc/shadow file.
Moreover, the smbpasswd file which I found is empty:
root@WZR-HP-G300NH:/# ls -la /tmp/var/samba
drwx------ 2 root root 0 Jan 1 1970 .
drwxr-xr-x 12 root root 0 Jan 1 1970 ..
-rw-r--r-- 1 root root 0 Jan 1 1970 smbpasswd

So it proved a bit elusive for the moment, which may be by design as we're talking about passwords.


Actually, I was only interested in the hashed password, because I was under the impression that you suggested one could enter the hashed password in the GUI instesd of the clear text password. I took this as a way of making it unreadable in any nvram backup files that one may have on disk. Now, I am probably being elusive ...
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2972
Location: Germany

PostPosted: Tue Sep 15, 2020 8:17    Post subject: Reply with quote
Samba passwords have never been saved in /etc/passwd, regardless of the samba version (would be new to me)

and the asterisk and the "/bin/false" in the passwd for NAS_user means that it is a system user who has no login shell

and the typo "Contab" is in the comments section
so not that important

>>

nvram show | grep samba3_users

samba3_users=[{"user":"bla","pass":"bla","type":1}]
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1414

PostPosted: Tue Sep 15, 2020 22:23    Post subject: Reply with quote
ArjenR49 wrote:

Actually, I was only interested in the hashed password, because I was under the impression that you suggested one could enter the hashed password in the GUI instesd of the clear text password. I took this as a way of making it unreadable in any nvram backup files that one may have on disk. Now, I am probably being elusive ...


Ooops my fault. I misunderstood. Via the GUI, no you have to enter the "clear text password". If DD-WRT is doing everything correctly it should hash the password before it ever saves it (and even should salt it so rainbow tables do not work). The only way not to would be to modify the file and provide your own hashed password.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum