I can't create new file or change existing file in linux server using Winscp

Hello everyone this post is all about creating and making changes in existing file on Linux server using Winscp this solution also works for those who can't login to putty as root user

First thing is to create new file or to make changes you have to login as root user. if you are logged in as standard user but not as root user then this is the problem.

You have to log out and connect Winscp using root user. if you are logged in as root user then you are good to go!

But when you try to connect as root user and you are not able to connect and getting access denied error or any other error but you are able to connect as standard user then problem is you don't have to connect to server remotely with root user then in that kind of situation what you need to do is login directly to server with connected keyboard and monitor(if your server situated remotely then skip this step and jump to Remote user paragraph). After logging in as root user open following file /etc/ssh/sshd_config 

you can use either

vi editor or nano editor to open that file

and find following line

PermitRootLogin XXXXXXXX (X means can be written any thing i.e. no, without password)

then change it to simply this

PermitRootLogin yes

reboot server you should be able to login as root user now you can create new files and change old files.


Remote User: If your server is situated remotely and you can't access your server physically then simply use putty and login as standard user. Once you are logged in as standarda user

login as: stduser

stduser@xxx.xxx.xxx.xxx's password:

once you are logged in standard user then type in su like this

stduser@xxx.xxx.xxx.xxx:~$ su

Password: user your root password

root@xxx.xxx.xxx.xxx:~#

now you can edit ssh_config file

Now your problem should be resolved and thanks for reading my post


Comments